Edit crontab with theย -u
ย argument to edit a crontab for a specific user:
sudo crontab -u www-data -e
Or, write your entry into the system crontabย /etc/crontab
, which takes an additional argument specifying the user to run as (usually root, but can be www-data).
*/5 * * * * www-data php /php/script