Modify php first
Modify php. ini
Open php. ini and modify the following two parameters. The parameter value is the maximum size of the files to be uploaded.
The code is as follows: |
Copy code |
Post_max_size = 125 M Upload_max_filesize = 120 M Max_execution_time = 90 |
1. post_max_size: specifies the maximum size allowed by POST data.
2. upload_max_filesize: indicates the maximum size of the uploaded file.
3. max_execution_time: It takes time to upload a file. This value is the default timeout value of php. If it is set to 0, it will not time out (it is recommended not to set this value ), if the file has not been uploaded after the time-out period expires, the upload will also fail. Therefore, when modifying the size limit of the file to be uploaded, adjust this parameter as appropriate, otherwise, the upload will fail.
Post_max_size is slightly larger than upload_max_filesize.
Modify nginx file size limit
The code is as follows: |
Copy code |
# Locate nginx. conf /Alidata/server/nginx-1.0.4/conf/nginx. conf /Alidata/server/nginx-1.0.4/conf/nginx. conf. default # Locate php. ini /Alidata/server/Zend/etc/php. ini /Alidata/server/php-5.2.17/etc/php. ini /Alidata/server/php-5.2.17/etc/php. Ini-zend_optimizer.bak |
Modify nginx. conf
Client_max_body_size 120 m;
Find client_max_body_size in The nginx. conf file. If no value exists, add this file. The 120m file is the file with a maximum size of MB.
Restart nginx and php.
Nginx restart
First Look for the location where nginx is located. If you know the installation location is the best, see the following command if you do not know the location.
The code is as follows: |
Copy code |
# Locate nginx | grep sbin /Alidata/server/nginx-1.0.4/sbin /Alidata/server/nginx-1.0.4/sbin/nginx |
The following figure shows the Restart command for nginx. Before the restart, run the-t option to test whether the syntax of the configuration file is correct.
The code is as follows: |
Copy code |
#/Alidata/server/nginx-1.0.4/sbin/nginx-t #/Alidata/server/nginx-1.0.4/sbin/nginx-s reload |
Php restart
The code is as follows: |
Copy code |
/Etc/init. d/php-fpm restart
|
After modifying the php. Ini file, run the preceding command to restart php.