0

I want to run

php /path/to/artisan opcache:optimize

to build laravel cache after php7.2-fpm start or after restart. I have tried to insert it on /etc/init.d/php7.2-fpm in do_start() method but failed the code didn't execute.

please any idea? thanks

1
  • You are supposed to do this when you deploy a new version of your code. Sep 6, 2018 at 12:46

1 Answer 1

0

solved by editing /lib/systemd/system/php7.2-fpm.service

i add ExecStartPost=/usr/bin/php /path/to/artisan opcache:optimize and then reload daemon

systemctl daemon-reload

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .