appstract / laravel-opcache

Laravel Package for OPcache
MIT License
1.34k stars 118 forks source link

How to use with Apache mod-php? #41

Closed jpuck closed 7 years ago

jpuck commented 7 years ago

I have a beginner's question, so thanks for your patience. Will this work with Apache mod-php, or just php-fpm?

The instructions say to modify the php.ini's opcache settings, but there are two different php.ini files on some servers, one for mod-php and another for cli. I assume I should be changing those settings for the web server's (mod-php) php.ini. But php artisan opcache:clear will use the cli php.ini, but does that affect the web server's (mod-php) opcache too?

Thanks for your time!

ovanschie commented 7 years ago

The package makes a request to your app, so it goes through your webserver and clears the PHP that is running your app. So if your app runs on mod-php it will clear the mod-php cache. It will not clear the cli-php.

This also applies to the other commands, they will get the info from the PHP that is running your app.