troubleshooting Question

permission denied to run cron job

Avatar of ksdean
ksdeanFlag for United States of America asked on
Linux OS DevPHP
4 Comments1 Solution1023 ViewsLast Modified:
I have a cron job that I want to run at 12:01 every night to update all the records in one filed of a table in a database. Currently I am getting an error when the cron job runs saying permission denied. Here is the exact text of the error (with the path changed):

/bin/sh: /xxxxxxx/homepages/33/xxxxxxx/htdocs/xxxxxxxx.php: Permission denied

This is how I have it set up:
the cron job calls the php file.
I have an require once in the php file to connect to the database
then the php file runs

I suspect that the permission denied error is coming because the user name is the username of the database, not the root user of the shell. Do I need to add a user login to my php file for the shell access? If so, how would I go about doing that?

I know the php file is running correctly because when I run it manually, it does what I want it to do.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros