appstract / laravel-opcache

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

PHP 7.4 Preload Support #96

Closed mpyw closed 4 years ago

mpyw commented 4 years ago

opcache_reset() is not going to reload preloaded files. It's just not possible using current opcache design, because during restart, they may be used by some process, and any modifications may lead to crash.

Still we can provide opcache:compile as an entrypoint for opcache.preload.

ovanschie commented 4 years ago

Should work if you put this code in a php script in your Laravel project, and point to the file.

<?php

echo shell_exec("php artisan opcache:compile --force");