3

I'm working on user login_register from, when I signup then data inserts into DB (and can also login), but the browser says:

   maximum execution time of 30 seconds exceeded

in \vendor\phpunit\phpunit\appveyor.yml: its already 1200

  - IF NOT EXIST php-installed.txt echo max_execution_time=1200 >> php.ini

when I signup then data is submitted into DB but it shows this https://ibb.co/YLv6N5g any solution to resolve this issue

Mehran
  • 175
  • 1
  • 10
pro
  • 609
  • 4
  • 17
  • 40

3 Answers3

5

Update max_execution_time in your php.ini file

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 300

This will set the execution time to 5 minutes.

Note: do not forget to restart apache server.

For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder).

Here is question for detail about this. How to locate the php.ini file (xampp)

Sagar Gautam
  • 9,049
  • 6
  • 53
  • 84
1

you will need to change is max_execution_time

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)

You can change the max_execution_time to 300 seconds like max_execution_time = 300

You can find the path of your PHP configuration file in your xampp/php/php.ini(Windows User) file And don't forget to restart your server

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
1

A php execution process if its connecting DB and doing insert or just simple loop, php will make sure it is always executed under a time limit which is set in php.ini's configuration called 'max_execution_time'. This avoids unnecessary resources used by a php script when it runs for extremely long time.

Now server may have multiple php.ini's, sometimes one for cli and one which actually affects the web server. You can do

<?php 
phpinfo();
exit;

at the start of public/index.php once or create a public/test.php file and add that in it(delete it once you see the data). In that you will be able to see correct location of php.ini

Also, the same phpinfo page will help you see the max_execution_time as well. So if you have increased it correctly, it should show the updated value there.

Going one step further, increasing the value even if resolves your issue, you should spend some time why it is taking so much time. For a normal request without large file posted to server, 30-60 seconds is a pretty decent execution time limit.

Mihir Bhende
  • 8,677
  • 1
  • 30
  • 37
  • its showing into 2 places i hv edited it in D:\xampp but m unable to find it in C:\windows https://ibb.co/p1Kv0PC – pro Feb 06 '19 at 05:57
  • see if [this](https://stackoverflow.com/questions/6185319/how-to-locate-the-php-ini-file-xampp) helps – Mihir Bhende Feb 06 '19 at 12:32