PHP.INI upload max?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bloodburn
    Junior Member
    • Apr 2004
    • 5

    #1

    PHP.INI upload max?

    Im just curious, I have a basic plan and was wondering what the max php upload limit is at in the php.ini file? I heard it was 2mb, but wasnt sure.
  • -Oz-
    Senior Member
    • Mar 2004
    • 545

    #2
    you can find out really easily by making a php file with:
    <?php
    phpinfo();
    ?>
    Dan Blomberg

    Comment

    • timg
      Member
      • Feb 2005
      • 84

      #3
      Oh, no!

      I just discovered this. I created a whole site (bought a domain etc) specifically for a user community uploading music files, and now I just checked (using the above script), and it's true: maximum 2 MB filesize. Can't get much of a music file that small (about 2 minutes on medium quality mp3).

      ~ Tim Gallant ~ http://www.pactumweb.com

      Comment

      • timg
        Member
        • Feb 2005
        • 84

        #4
        Originally posted by timg
        I just discovered this. I created a whole site (bought a domain etc) specifically for a user community uploading music files, and now I just checked (using the above script), and it's true: maximum 2 MB filesize. Can't get much of a music file that small (about 2 minutes on medium quality mp3).

        I now see that my other host has a 20MB upload max - and that's just a personal account. (Precisely the problem - it's a mess with databases using add-on domains.)

        Andrew, is there any consideration at all of bumping up that 2 MB limit? It's awfully low. Even some free sites have 10 MB maximums.

        I don't expect this to be a super high-traffic site, but file sizes need to be closer to 5-8 MB than 2.
        ~ Tim Gallant ~ http://www.pactumweb.com

        Comment

        • Buddha
          Senior Member
          • Mar 2004
          • 825

          #5
          You should be able to change that yourself it's PHP_INI_PERDIR.
          "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

          Comment

          • djn
            Senior Member
            • Mar 2004
            • 140

            #6
            I suspect that Buddha's reply, while correct, might be a little cryptic for newbies. What he means is that upload_max_filesize is one of those PHP setting you can define on a directory by directory basis, overriding server-wide settings. When PHP is installed as CGI (like here) the way to go is to put a text file named php.ini in the same folder as the script(s) for which you're setting the value. Php.ini should contain this line:

            upload_max_filesize = 8M (or whatever suits you best...)

            There is a comprehensive list of php setting at http://it2.php.net/manual/en/ini.php#ini.list
            Those with a value of PHP_INI_PERDIR or PHP_INI_ALL in the 'Changeable' column can be modified this way.

            Comment

            • timg
              Member
              • Feb 2005
              • 84

              #7
              Thanks, guys. I don't know anything about configuration, really. So to clarify this: if I create a file named php.ini and simply include this:

              upload_max_filesize = 8M

              ... that should work?
              ~ Tim Gallant ~ http://www.pactumweb.com

              Comment

              • djn
                Senior Member
                • Mar 2004
                • 140

                #8
                Yes, this is the way it works (as long as the php.ini file is in the same folder as your PHP script)!

                Comment

                • timg
                  Member
                  • Feb 2005
                  • 84

                  #9
                  Thanks. I haven't got it to work.
                  ~ Tim Gallant ~ http://www.pactumweb.com

                  Comment

                  • timg
                    Member
                    • Feb 2005
                    • 84

                    #10
                    Still no luck.

                    Here's the deal: this is for a Content Management System (CMS) that has a module for uploading audio files and automatically generating a songlist. The audio is not in the same directory as the calling script. The audio files are stored in media/songs/ directory; the module is in its own directory. I have tried putting the php.ini file in:

                    the media/songs/ directory
                    the modules/songlist/ directory
                    both of the above simultaneously
                    the root (public_html) directory

                    None of the above work.

                    Any ideas?
                    ~ Tim Gallant ~ http://www.pactumweb.com

                    Comment

                    • djn
                      Senior Member
                      • Mar 2004
                      • 140

                      #11
                      Well, if that module is a piece of PHP that is included at runtime into another script the php.ini should go into the folder of the main script...

                      Comment

                      • SeanCustomer
                        Junior Member
                        • Jun 2006
                        • 16

                        #12
                        One last thing...

                        For those of you reading the forums to find a solution to this problem:

                        It was recently brought to my attention that the solution here is yet still incomplete. What's missing is the semicolon. So, create a plain text file called php.ini and include

                        upload_max_filesize = 8M;

                        Notice the trailing semicolon. Save, upload to script directory. And now you're done.

                        (Credit: Thanks to the Dathorn tech guys for pointing out my stupidity.)

                        Comment

                        Working...