By default, You need to optimize some PHP settings in order to be able to upload larger size files, have more connections at the same time, etc. , including:
- Increase PHP execution time (PHP param max_execution_time is 30
...
- seconds
...
- by default)
- Increase Max Upload Size
In this tutorial, I will guide you increase this value both on nginx and apache to how to update on both Nginx and Apache server.
Nginx server
Changes in php.ini
On CentOS: php.ini is saved in: /etc/php.ini
...
(Increase php execution time to 3000 seconds)
Changes in Nginx Config
On file nginx config for your site, add this line fastcgi_read_timeout 3000; like this:
...
By Default, the path of nginx config is saved in /etc/nginx/nginx.conf (CentOS) or /etc/nginx/sites-available/default (Ubuntu)
Reload nginx and php
Run these commands:
Code Block | ||||
---|---|---|---|---|
| ||||
systemctl restart nginx #CentOS systemctl restart php-fpm #Ubuntu (which 7.0 is php version) systemctl restart php7.0-fpm |
Check your result
Check on phpinfo
Apache Server
Changes in php.ini
On CentOS: php.ini is saved in: /etc/php.ini
...
Code Block | ||||
---|---|---|---|---|
| ||||
max_execution_time = 3000 |
Reload apache
Run these commands:
Code Block | ||||
---|---|---|---|---|
| ||||
#CentOS systemctl restart httpd #Ubuntu systemctl restart apache2 |