0

We've noticed emails from e.g. contact forms were not being send even though the site said they were. We've added the cronjob to the system, but when we tried to test it by executing cron.php, we got a 403 FORBIDDEN.

url: https://merchgeex.com/cron.php

How can we fix this?

/var/log/apache2/error.log -->

[Thu Oct 06 07:20:03.760087 2016] [access_compat:error] [pid 7969] [client *ip*] AH01797: client denied by server configuration: /var/www/cron.php

2 Answers 2

1

correct way to test cron is to execute inside your server, in console:

/var/www/cron.sh

make sure this file is executable:

chmod u+x /var/www/cron.sh

and check cron log and output.
you have .htaccess file that blocks cron.php execution from web.

email issues also must be logged into /var/www/var/log/ or mail log in system /var/log/

1

Ideally, you shouldn't be kicking off your cron processes from the web.

That said, if you REALLY need to do so, here are a couple of options:

(Option 1) Create a new file (cronweb.php) with the following content:

<?php

include('cron.php');

?>

(Option 2) Modify .htaccess rules

Edit the $MAGENTO_HOME/.htaccess file and comment off this line htacess - cron.php


FWIW - The advantage of option 1 over 2 is that you can (via .gitignore) prevent that file (cronweb.php) from being deployed to your higher instances - thereby 'locking down' your PROD instances v/s allowing you to debug when working on DEV instances.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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