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:
In general, these PHP settings can be configured on server. If you are NOT familiar with server management, we strongly recommend you to reach out to hosting provider or technicians for assistances to configure PHP settings.
In this tutorial, I will guide you to how to update on both Nginx and Apache server.
On CentOS: php.ini is saved in: /etc/php.ini
On Ubuntu: php.ini is saved in: /etc/php/7.0/fpm/php.ini (which 7.0 is php version that installed in your server)
max_execution_time = 3000 post_max_size = 20M upload_max_filesize = 20M |
(Increase php execution time to 3000 seconds, max upload size to 20M)
On file nginx config for your site, add this line fastcgi_read_timeout 3000; like this:
location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 3000; } |
(Increase request time out to 3000 seconds). Just add this line fastcgi_read_timeout 3000; keep default other configurations. You can preference this tutorial Install phpFox on nginx server for more detail
By Default, the path of nginx config is saved in /etc/nginx/nginx.conf (CentOS) or /etc/nginx/sites-available/default (Ubuntu)
Run these commands:
systemctl restart nginx #CentOS systemctl restart php-fpm #Ubuntu (which 7.0 is php version) systemctl restart php7.0-fpm |
Check on phpinfo
On CentOS: php.ini is saved in: /etc/php.ini
On Ubuntu: php.ini is saved in: /etc/php/7.0/apache2/php.ini (which 7.0 is php version that installed in your server)
max_execution_time = 3000 post_max_size = 20M upload_max_filesize = 20M |
(Increase php execution time to 3000 seconds, max upload size to 20M)
Run these commands:
#CentOS systemctl restart httpd #Ubuntu systemctl restart apache2 |