Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with php artisan optimize #134

Open
Kryptonien opened this issue Sep 7, 2021 · 1 comment
Open

Not compatible with php artisan optimize #134

Kryptonien opened this issue Sep 7, 2021 · 1 comment

Comments

@Kryptonien
Copy link

Hi,

I noticed the lib doesn't work if you're compiling with php artisan optimize.

As a workaround i'm doing

php artisan optimize clear
php artisan opcache:clear
php artisan optimize

You might need to declare a route somewhere in your package.

@hakimzulkufli
Copy link

hakimzulkufli commented Nov 23, 2021

This ticket sounds too vague but I'm assuming it's related to the errors when running php artisan opcache:compile after php artisan optimize. If not, I will open a separate ticket. I probably should since I'm using php 7.2 and laravel-opcache 3.2.1.

Running php artisan optimize will also compile the Blade views, like php artisan view:cache. Because of this, laravel-opcache will not able to compile the views into OPcache.

In my case, the following error occurred when running php artisan opcache:compile after php artisan optimize:

-- storage/framework/views/17d49dbffa9f42d427d8bc281997de1c39cc043e.php

syntax error, unexpected 'Im' (T_STRING), expecting ',' or ')'

I have to run:

php artisan optimize
php artisan view:clear
php artisan opcache:compile

...in that order. I'm not sure if this affects anything or if compiling the views are needed when using laravel-opcache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants