-1

I have changed every last PHP.ini, *.ini related or unrelated on my server for setting post_max_size to 8000M but its not working.But atleast 50M will do my work.I am stuck here. restarted server after changing every php.ini
httpd - k restart
even stopped server and start again.

but i cant see a small change in PHP.info

tried various tricks like
1) php_ini
2) .htaccess
3) .user.ini
but not getting desired result .Please help

I have dedicated server.With WHM and root access but still nothing working CentOS release 6.8 (Final)

All the suggested answers make change in HTACESS or php.ini while i already changed on it. more than any time.

Amit Sharma
  • 1,968
  • 5
  • 24
  • 35
  • 2
    What are you attempting to do? Do you still see the old value when you view phpinfo(), or is your upload just not working? If you're uploading a file, have you tried changing `upload_max_filesize`? – aynber Jan 10 '17 at 16:37
  • Run a `phpinfo()` and look at the first page for a line that tells you where the `php.ini` file is being loaded from – RiggsFolly Jan 10 '17 at 16:39
  • [Do a little reading](http://php.net/manual/en/features.file-upload.php) – Jay Blanchard Jan 10 '17 at 16:39
  • yes i did everything , the very first thing i did is goto php_info find proper directory and edit that php.ini file – Amit Sharma Jan 10 '17 at 16:40
  • Are your changes applied or not (do you see them in phpinfo() )? – Blackbam Jan 10 '17 at 16:41
  • @ aynber i am still seing old value in php.ini – Amit Sharma Jan 10 '17 at 16:42
  • @Blackbam i am still seing old value in php.in – Amit Sharma Jan 10 '17 at 16:43
  • 1
    `post_max_size` is not the only thing that can prevent an upload from working. I think you should edit your question to add more information about what you're trying to do in general, and what specific problem you're having. You've included a lot of things you've tried, which is good, but "not working" is not much to go on. – Don't Panic Jan 10 '17 at 16:48
  • Possible duplicate of [PHP : settings memory\_limits > 1024M does not work](http://stackoverflow.com/questions/9276212/php-settings-memory-limits-1024m-does-not-work) – Blackbam Jan 10 '17 at 16:59
  • @ExtjsCommander Its maybe not an exact duplicate as you asked for post_max_size but the answers of the other post may be sufficient? – Blackbam Jan 10 '17 at 17:01
  • its not php then, it's apache refusing it. google LimitRequestBody – hanshenrik Jan 10 '17 at 19:30

1 Answers1

1

First create a phpinfo.php file within your web directory (ideally in the same folder where the scripts you are testing are saved) containing:

<?php
phpinfo();

Then access this file using a browser. Right close to the top there is a line saying:

Loaded Configuration File /etc/php/some/path/php.ini

Edit the loaded php.ini file as follows:

; Maximum allowed size for uploaded files.
upload_max_filesize = 50M

; Must be greater than or equal to upload_max_filesize
post_max_size = 50M

Your question mentions only post_max_size, but if your form accepts files you need to change upload_max_filesize too.

After that you need to restart the web sever (apache?). If you are using php-fpm then you need to restart that process. I don't know about centOS, but for ubuntu commands can be:

sudo service apache2 restart
sudo service php-fpm restart

Reload the phpinfo file in your browser and check if both values have been updated.