data is inserting in db but displaying error data is inserting in db but displaying error laravel laravel

data is inserting in db but displaying error


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 SAPImax_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)


you will need to change is max_execution_time

;;;;;;;;;;;;;;;;;;;; Resource Limits ;;;;;;;;;;;;;;;;;;;;max_execution_time = 30     ; Maximum execution time of each script, in secondsmax_input_time = 60 ; Maximum amount of time each script may spend parsing request datamemory_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


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.