Yes, zPanel and not cPanel. The open source alternative to cPanel. Setting up a cron job in zPanel is a little more difficult than setting it up in cPanel. Hopefully the talented folks working on the newer versions can make this process a little easier.
Recently I was in the need to transfer a web program from my cPanel server to my zPanel server. It requires a cron job in order to run correctly. Normally, you just click the cron job link and fill in the line in cPanel. zPanel looks like it is the same way but there are a few peculiarities I ran into. Let me first start off with the correct steps and then I can tell you where I ran into issues.
- Make sure your php file is located in the domain directory. You can’t keep it in the main directory. For example pcprime_org\cron.php and not \cron.php or home\cron.php
- Be sure to change the permissions on “/var/spool/cron” to 777. If you installed zPanel then you would know how to change the directory permissions. If not, then ask your webhost to change it for you.
- You can’t add any parameters at the end of the line. In other words nothing after the end of the directory line.
From a poster in the zPanel forums named kotakomputer:
Re: [Cron] Your script does not appear to exist at that location…
Thanks jd1pinoy, take 2 days for me to figure it out.
For those experience this Cron issue, here are the summaries:
- make sure /var/spool/cron owned by apache:apache and permissions 770
- make sure /var/spool/cron/apache owned by apache:apache and permissions 660
- the right Script path is: your_domain_com/CRONFILE.php or your_domain_com/SUBFOLDER/SUBFOLDER/CRONFILE.php
Example for WHMCS Script path is: your_domain_com/admin/cron.php
I didn’t follow his instructions but I think it is very similar to what I have written. I kept getting this error message “your script does not appear to exist at this location. I tried so many variations that I was beginning to forget which ones I had already tried. At some point I got another error message which led me to finding this info. I managed to not have the php file in the right location – this also required me to delete and reinstall everything in my domain directory and I didn’t have permissions set properly. I just don’t know enough to know why all these steps were needed in the first place then again I have been quite satisfied with zpanel thus far.