I want change the limit of PHP upload file's size
And this is some information of the output my phpinfo:
Configuration File (php.ini) Path /etc/php5/apache2
Loaded Configuration File /etc/php5/apache2/php.ini
And this is the content of my php.ini file:
upload_max_filesize = 50M
post_max_size = 50M
memory_limit = 128M
Then I restart Apache 2, but the phpinfo shown is still:
upload_max_filesize 2M
The default location for the php. ini file is: Ubuntu 16.04: /etc/php/7.0/apache2.
user. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.
If you can access one of your PHP files, open it in a editor (Notepad) and insert phpinfo(); after <? php on a new line. This will tell you the php. ini location.
Check php. ini in CLI (Command Line Interface): To know about php. ini, simply run on CLI. It look for Loaded Configuration File in output for the location of php.
I have solved my question.
There is a syntax error in php.ini in line 109, so the next all syntax does not execute.
There is a good chance you didn't have permissions to modify the php.ini file. If you just browse to it via a normal folder window and click it Gedit (or whatever your default text editor is) won't be able to open it with write permissions.
You should be able to get away by sudo nano /etc/php5/apache2/php.ini
(then your password at the prompt) and then changing the variables. Then be sure to write out (Ctrl + O) or make sure you confirm the save on exit.
For anyone wondering why the php.ini modification is not applied even after all directives are fine and restarting the apache on ubuntu, try restarting apache with sudo
sudo service apache2 restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With