1
votes

I want to adjust the post_max_size and upload_max_filesize without altering /etc/php.ini

PHP Version 5.3.27 root directory: /var/www/html/my_site

Here are the things that I did:

  • I added php.ini under html directory (didn't work)

    memory_limit = 96M
    post_max_size = 64M
    upload_max_filesize = 64M
    
  • I added .htaccess file under html directory (didn't work)

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    
  • I also added both of them under /my_site directory and none of them worked

  • Everytime I add each of them I restart the server

  • I also changed php.ini to php5.ini

  • I also changed

    php_value
    

    to

     php5_value
    
  • Adjusted permission issues

What went wrong?

1
Got any error messages with your attempts? Are you running mod_php at all or possibly the cgi/fcgi version?mario
I have checked the error in logs saying PHP Warning: POST Content-Length of 15799451 bytes exceeds the limit of 8388608 bytes in Unknown on line 0, referer:DetectiveDrone
And how will I know if I'm running a mod_php or cgi/fcgi version?DetectiveDrone
You can check if your changes in .htaccess are taking effect by using ini_get(flag_name) in your php files. e.g.: echo ini_get('upload_max_filesize') would output the value of upload_max_filesize.Simon Robb

1 Answers

0
votes

Many shared hosts restrict the flags you can use in your .htaccess, and upload_max_filesize/post_max_size are common ones. If you're on a shared host contact tech support to confirm this.