1

I'm attempting to run all my jobs using the URL Method. The URL I'm trying (anonymized here of course) is:

https://mysite.org/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=MY_USERNAME&pass=MY_PASS&key=MY_SITE_KEY

Visiting this URL gives me a 404 error.

To test that cron runs at all on my server, I created a simple php script,

<?php
mail ("cron@mysite.org", "Cron is Go", "Hello World from my-cron.php!");
?>

and put it in a file my-cron.php. It sends me an email when visited. I then created a cron job to curl its url every minute. It worked in every directory I moved it too until it got to bin at which point the cron job did nothing and visiting the URL in browser gave me a 404 error.

Changing the permissions on bin from 0775 to 0755 allows the script to run. I thought that the jobs URL would work, but I still get a 404 error.

Update: I changed bin from 0775 to 0755 and cron.php to 0755, and it works now. Is this safe to do?

2

Two answers: First, yes, changing the permission should be safe to do. Note, however, that you'll have to repeat this process every time you upgrade.

Second - this isn't a normal restriction, so I'm guessing you're running CiviCRM on shared hosting. The change you described removed the "group owner can write to this file" permission of cron.php. You did NOT change who could read or execute the file - so this shouldn't have had an effect.

  • If shared hosting is working for you in all other respects, then this is probably a non-issue. However, it is exactly this sort of issue that causes me to recommend not using shared hosting - you have to spend time handling the quirks of whomever runs the server, and it's different for every host. An hour of my time spent troubleshooting an issue like this for someone could pay for a year of a VPS! – Jon G - Megaphone Tech Aug 17 '17 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.