SOLVED Setting up PHP cron jobs to run as each user account

Mister9

Active Member
Apr 28, 2010
29
0
51
cPanel Access Level
Root Administrator
I'm trying to figure out the best way to solve this issue.
An account is trying to set up cron jobs tasks that will use PHP scripts with mkdir.

The issue is this returns a permission denied. I know I can resolve this by setting a root cron job on the server for the account but is there a simple way to set each user accounts cron job that runs PHP to run as each user account so it can create, delete, directories easily?
 
Last edited by a moderator:

Mister9

Active Member
Apr 28, 2010
29
0
51
cPanel Access Level
Root Administrator
Make sure that that they use the dirname(__FILE__) or __DIR__ in the input for mkdir. And that the cron job is run with the correct path.
Thank you for leading me in the right direction.
I checked the path where it was trying to mkdir and it was the incorrect path :eek:.
After correcting it, working perfectly.