- Create a service file like
php_worker.service - Put it in
/lib/systemd/system/ - Reload
systemdusing command:systemctl daemon-reload - Start service using command:
systemctl start php_worker.service - Enable auto start using command:
systemctl enable php_worker.service
For testing script and for manual start (without using systemd) use command:
php /var/www/my-domain-name.com/private/worker.php -u www-data