The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Increase upload size

Discussion in 'General Discussion' started by dubbelpunt, Nov 1, 2010.

  1. dubbelpunt

    dubbelpunt Registered

    Joined:
    Nov 1, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have a Linux Hosting account at Whois.com.

    I've made an adminarea to upload movieclips to the website. I saw that the maximum upload filesize is 20Mb.

    Is there a possibility to increase this size? I read in the knowledgebase that I could put an php.ini file in the directory of the script, but this is not working.

    I did the following:
    1) make php.ini file with the next commands:
    post_max_size = 80M
    upload_max_filesize = 60M
    memory_limit = 128M

    2) put this file in the directory of the script
    3) put the permissions on 770 (also tried with 777).
    4) I set the time_limit in my php-script to 1200 seconds.

    What am I doing wrong?

    Thanks
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If the host is running DSO rather than suPHP, then adding a php.ini file will not work. You'd instead need to put the values into .htaccess in that directory and use:

    Code:
    php_value upload_max_filesize 60M 
    php_value post_max_size 80M
    If you add these values and get an Internal Server Error, then they aren't using DSO and you should remove the values.

    Next, you can put a phpinfo page onto that directory to see if it's loading your php.ini also. In the phpinfo page, put the following:

    Code:
    <?php
    phpinfo();
    ?>
    Call the page whatever you want so long as it ends in .php so php.php would work. Load the page in a browser and see what the "Configuration File (php.ini) Path" shows up as for the directory. If it's showing /usr/local/lib, then they are forcing the global php.ini if they are using suPHP. You'd simply have to talk to them about changing the sizes then.

    If they are using CGI or FCGI, you can try to configure it to use your own php.ini as well, but it's best you come back and tell us what they are actually using for the PHP handler. If you don't know, again just ask them.
     
  3. dubbelpunt

    dubbelpunt Registered

    Joined:
    Nov 1, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the quick reply Tristan,

    .htaccess gives an Internal Server Error.

    The Configuration File (php.ini) Path is /usr/lib.

    CGI-FCGI is enabled, but I don't know how I can manage this to let it work with my own php.ini.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Did you actually ask your host? I ask this as even under suPHP, it appears as CGI/FCGI in the phpinfo page, so you can't go by the phpinfo page. You need to check with your host.

    If you really are using CGI or FCGI (and it does matter which as both use different methods to get a php.ini file), you can use my guide on it:

    Individual php.ini files for PHP FCGI and PHP CGI - cPanel Forums

    This was done as my non-staff account previously, but it's my how-to so I've tested it and it does work with cPanel to use the above steps.

    Really, don't just do the how-to trying to figure out which PHP handler you have. Bite the bullet and ask your host first. This way we aren't trying to troubleshoot something when we can simply know for sure which one it is.
     
Loading...

Share This Page