My request only last 3 min and return 500 Internal Server Error. Here is my apache error_log file: Script timed out before returning headers: index.php, referer: ...
Can anyone help me how to solve it? I already set execution time but still not working: ini_set('max_execution_time', 0);
Here is my code
public static function compress($source, $destination)
{
ini_set('max_execution_time', 0);
Tinify\setKey(env('API_KEY'));
Tinify\fromFile($source)->toFile($destination);
}
My code only using tinypng api to compress image, i think it's too long
It cause of 1. If you kept sleep function eg sleep(5000); 2. PHP version7 make it 5.6 something.
If you did fix please share your answer. Thank You.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.