Skip to content

What is the correct path to use for PHP?

The correct path to use for PHP when setting up cron jobs or running scripts from the command line is:

/usr/local/bin/php

For example, a cron job that runs a PHP script would look like:

Terminal window
/usr/local/bin/php /home/username/public_html/cron.php

Replace username with your cPanel username and adjust the script path as needed.