0

I have a php script that inserts random data in mysql database. (approximative 1 milion rows) Afer the script begins to run on my browser, after a few minutes (ex. 10 min or so) the script stops. (Chrome is giving me "No data recieved")

In my script I have set the followings:

ini_set('display_errors','On');
ini_set('error_reporting',E_ALL);
ini_set('max_execution_time' ,0);
ini_set('set_memory_limit', '10240MB');

For this project I am using the Laravel framework but I don't think it has something to do with it.

Have any ideas?

1
  • 1
    Try this set_time_limit(0); Commented Jun 4, 2014 at 11:58

2 Answers 2

1

It's always a good approach to do such long running jobs via SSH (if you have SSH access to your server). Then you can execute any PHP-Script via php your-script.php. You just to keep two things in mind: you need to bootstrap your framework properly (if the script depends on it), and then there is also a timeout for SSH connections. You can work around this limitation by sending the running job in the background or use the screen command.

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

Comments

1

Found the problem. It was from the framework. For best practices I recomend: https://laracasts.com/lessons/eager-loading

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.