laravel-opcache icon indicating copy to clipboard operation
laravel-opcache copied to clipboard

Timeouts and Syntax Errors with v3.0

Open jackwh opened this issue 6 years ago • 3 comments

I've just tried to upgrade to v3.0, and found two issues preventing me from upgrading:

  1. The web server times out when making the opcache:compile request, after 30 seconds. Of course this will vary by each server, but to get around it, I'm forced to use ini_set('maximum_execution_time', 0), which I would rather not do. Is there a better fix that can be made within the package itself for this?

  2. My application is using PHP 7.4. When trying to compile the vendor directory, some packages (e.g. symfony/var-dumper) include test cases for PHP 7.4. When a file with PHP 7.4-specific code tries to compile, the command fails with a 500 error.

I tried excluding the paths, but the exclusion didn't seem to make any difference. Even so, when updating packages, it is feasible more PHP 7.4 code could be added at any time.

I would have thought surrounding the optimisation of each individual file in a try/catch might be a suitable fix?

jackwh avatar Aug 01 '19 14:08 jackwh

I would have thought surrounding the optimisation of each individual file in a try/catch might be a suitable fix?

it's there.

https://github.com/appstract/laravel-opcache/blob/411e67ab0575cc589a719ef6ad05cbd2086b6aac/src/OpcacheClass.php#L64

Maybe this can help you

https://github.com/appstract/laravel-opcache/issues/90#issuecomment-522003043

ovanschie avatar Aug 16 '19 13:08 ovanschie

Thanks for your help, adding Tests (case-sensitive T) to the exclusions has fixed point 2.

Point 1 still stands — any thoughts on how to avoid hitting maximum execution time?

jackwh avatar Sep 19 '19 16:09 jackwh

30 seconds already seems long for most applications, so i'm not sure if we need to set that any higher.

Maybe we can make a config option for this

ovanschie avatar Sep 29 '19 20:09 ovanschie