My php.ini settings are not reflected in phpinfo. It still shows upload_max_filesize as 2M but I have set it to 50M in php.ini. Can you please tell how to change php.ini properly? I'm using Ubuntu 14.04 and I made changes to file in /etc/php5/apache2/php.ini as described in Find the correct php.ini file and also restarted apache server and even restarted my laptop. Is this the right php.ini file I'm making changes to? What could be the possible reasons?

2 Answers 2


Some time it happens that in php.ini, there is some syntax error on some line number for example

error_reporting = E_ALL && ~E_DEPRECATED && ~E_STRICT

In this case the apache does not load configuration after that line number. So this is bit complex to figure out syntax error in php.ini therefore you should try other ways to fix and you should try this solution at the end.

  • It took me two days to find this issue thanks for sharing such a wonderful insight!
    – tsega
    Aug 30, 2016 at 7:20

You should modify post_max_size too.

According to php manual:

 post_max_size integer
    Sets max size of post data allowed. This setting also affects file upload. 
    To upload large files, this value must be larger than upload_max_filesize. 
    If memory limit is enabled by your configure script, memory_limit also affects
    file uploading. Generally speaking, memory_limit should be larger than

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.