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

3
  • rather than monkeying with config can you chunk your query? How many queries are you running? Commented Feb 6, 2019 at 6:36
  • 12 queries..... Commented Feb 6, 2019 at 7:47
  • Thats doesnt sound too much of a query. Would you mind sharing you eloquent query so that I can have a look. Commented Feb 6, 2019 at 23:47

3 Answers 3

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)

Sign up to request clarification or add additional context in comments.

16 Comments

can u plz tell me where is this file located
@programmer0001 What's your system windows or linux ?
@programmer0001 xampp/php/php.ini (for Windows User)
@programmer0001 did you restart xampp ?
I have gone through your code and there aren't any errors in it. So as @SagarGautam said try by clear and reconfigure cache by using php artisan config:cache
|
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

1 Comment

still same issue after it
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.

2 Comments

its showing into 2 places i hv edited it in D:\xampp but m unable to find it in C:\windows ibb.co/p1Kv0PC
see if this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.