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

alexander.polomodov
  • 1,060
  • 3
  • 10
  • 14
Hernawan
  • 61
  • 8

1 Answers1

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
Hernawan
  • 61
  • 8