PHP - execution time limit
Order task on per image.
- check image exist
- create thumbnail
- save information of images and thumb to database
If we do it with very more images and need more time to execute request than default of php (30s)
Does the time contain php execution time + mysql time ? or only time for php ?
When i save information ,some images missing infor when still insert to database
example : with 30 images
php : scan information of 25 images
mysql: insert 30 images infor
i think php process time exceed to default time , request will be stop. so mysql only insert 25 images infor. That right ?
$infor
if (// create thumb and get infor successfull) // if exceed time , why script don't stop inserting infor
{
$infor return inform开发者_JAVA技巧ation of images
}
$database->insert($infor)
what i want to know is when script will be stop. if process is create thumb step and be stopped by exceed time, why script continue insert null infor to database
You can increase time in .ini files or code like this
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
Or use set_time_limit function on PHP.
http://php.net/manual/en/function.set-time-limit.php
in such cases use
set_time_limit(0);
0 means unlimited . Use this function on top of your php file which can take long time .
精彩评论