SuperMar1o
SuperMar1o

Reputation: 680

Trying to get cron.php working in Cpanel for Magento

I have been using this

/usr/bin/php -q /home/username/public_html/sub.domain.com/cron.php as my command

for the cron job, but I dont get anything. No customer emails, no errors, nothing. When I use

php /home/username/public_html/sub.domain.com/cron.php

I get the error (Or not error)

X-Powered-By: PHP/5.4.37
Content-type: text/html

and if I use

/home/username/public_html/sub.domain.com/cron.php

I get the overly long error

/home/username/public_html/sub.domain.com/cron.php: line 1: ?php: No such file or directory
/home/username/public_html/sub.domain.com/cron.php: line 2: /bin: is a directory
/home/username/public_html/sub.domain.com/cron.php: line 3: access-logs: command not found
/home/username/public_html/sub.domain.com/cron.php: line 4: access-logs: command not found
/home/username/public_html/sub.domain.com/cron.php: line 5: access-logs: command not found
/home/username/public_html/sub.domain.com/cron.php: line 6: access-logs: command not found
/home/username/public_html/sub.domain.com/cron.php: line 7: syntax error near unexpected token `('
/home/username/public_html/sub.domain.com/cron.php: line 7: ` * This source file is subject to the Open Software License (OSL 3.0)'

Any idea what im doing wrong here?

FYI: The permissions of the cron.php file is 744. (For search results) This is for a Magento 1.9 install that is not sending emails. Check below for the fixes.

Upvotes: 0

Views: 1463

Answers (1)

SuperMar1o
SuperMar1o

Reputation: 680

After a few tries, this worked for me.

*   *   *   *   *   php /home/sturdi6/public_html/cron.php > /dev/null

However the underlying issue I was having (sending confirmation emails) ended up being me needing a SMTP plugin and configuring it to use a webmail address I made in cpanel

SMTP Pro Email - Free Custom SMTP Email

That in addition to installing a scheduler to make sure all the cron jobs were managed, had them sending out immediately as it should of all along lol

AOE Scheduler

Also some neat things to make note of. The Magento Cleanup Tool (mass repairs permissions on the folders structure) and the "Magento not sending Emails?" site, which had some useful scripts for making sure your mail is enabled and sending to begin with.

Upvotes: 1

Related Questions