문제

I am using codeigniter while i am importing table data row by row to a mysql tables where rows are more than 25000 in the table so it takes time to read from one table and insert into another table.

I noticed that every time i run the the my script like: http://domain.local/importdata it stops the script after importing some rows and after checking the time of its execution its exactly 120 seconds always.

I tried to set_time_limit(0); but no use still it stops after 120 seconds.

in phpinfo() it shows that default max_execution_time is 300.

In addition I am using zend server on windows machine.

thanks in advance.

도움이 되었습니까?

해결책

First, the function you should be using is set_time_limit().

Assuming that it's just a typo, your server administrator may have placed restriction on the server. This means you cannot go over that limit. Just imagine if you have an endless loop somewhere and your code will never timeout. To verify, try using set_time_limit(0) and execute phpinfo(). You will see in the output two values. In the right-most column the master value which is in the PHP configuration, and the other one the local value which will take precedence.

The Zend manual mentions that you should not be using it for files with long execution times. Follow the instructions on how you can blacklist a file. Also, check RequestTimeout and ConnectionTimeout in zendenabler.conf in the etc dir if you are using Apache. I think the reason why it's stopping is not because of PHP but because of Apache or Zend.

다른 팁

If You are using Zend Server over Windows this could be fix your problem:

Zend Server Help : configuring_php_timeouts_under_windows_apache

120 seconds is also a common browser timeout period.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top