Welcome to the Hindi Tutor QA. Create an account or login for asking a question and writing an answer.
Sima in Web Hosting

By Default hosting has an execution time limit of 120 seconds for PHP scripts, which is not enough for performing a full backup/restore of your website.

1 Answer

+2 votes
Pooja

Increase Maximum PHP Execution Time

Find the file called: php.ini on your server and follow below steps

With apache2 and php7.4 installed you need to make three changes in the php.ini file. First open the file for editing, e.g.:

For PHP v7.3

sudo nano /etc/php/7.3/apache2/php.ini

For PHP v7.4

sudo nano /etc/php/7.4/apache2/php.ini

Next, search (Ctrl + W) in this file for the max_execution_time entry, by defaul it has 30 second, for example:

max_execution_time=30

You can increase value as your requirement. 

Now Restart Apache Services for changes to be applied.

sudo systemctl restart apache2

For PHP-FPM

If you enabled PHP-FPM, then type this command line for open and edit php.ini

sudo nano /etc/php/7.4/fpm/php.ini

Edit, as your requirement:

memory_limit = 300M
post_max_size = 200M
upload_max_filesize = 100M
max_execution_time=300

Restart Apache And PHP-FPM Services for changes to be applied.

sudo systemctl restart apache2
sudo service php7.4-fpm restart

Increase the limits in php.ini

You can increase the allowed upload size of phpmyadmin by editing your server's php.ini configuration file.

With apache2 and php7.4 installed you need to make three changes in the php.ini file. First open the file for editing, e.g.:

sudo nano /etc/php/7.4/apache2/php.ini

Next, search (Ctrl + W) for the post_max_size entry, and enter a larger number than the size of your database, for example:

post_max_size = 1024M

Next edit the entry for memory_limit and give it a larger value than the one given to post_max_size.

memory_limit = 1024M

Then ensure the value of upload_max_filesize is smaller than post_max_size.

upload_max_filesize =  1024M

The order from biggest to smallest should be:

    memory_limit = 300M
    post_max_size = 200M
    upload_max_filesize = 100M

Please Note : post_max_size should be larger than upload_max_size.

Restart Apache Services for changes to be applied.

sudo systemctl restart apache2

Related questions

...