How Do I Get Crontab to Run a Whole Directory of PHP Files?

Solution 1:

When you run php *.php then PHP interpreter executes only the first file. You can check it outside of cron environment.

You can use run-parts to run all executables in a specific directory. See run-parts man page

You'll need to make your PHP files executable with a proper #! header and executable bit. Your crontab should look like

*/1 * * * * run-parts /var/www/mywebsite.com/path-to-my-awesome-php-scripts/crons