nickyb
nickyb

Reputation: 325

Can Cron jobs access password-protected directories?

I have a PHP script that I'm going to run with a Cron periodically to update some statuses. If I place the script in a directory that is password protected does the server still have access to execute the script?

If the script is in a password protected directory that requires http authentication - "username" "password", what cron command would I use to execute the script located here: "public_html/wp-content/stats/status.php"?

The script works fine if I access it over the web in my browser, and enter the htauth credentials.

Upvotes: 0

Views: 2267

Answers (1)

nickyb
nickyb

Reputation: 325

In case anyone else needs the same cron command to execute a php script:

php -q /home/cpanelusername/public_html/path/to/your/file

Upvotes: 1

Related Questions