Jump to content

WHMCS Cron Job Activity Email Stopped


prem101

Recommended Posts

Hello,

Last week i changed my admin directory and made access to admin directory via a user password. Also in cron i specified the same admin directory.

 

But after doing this the Mail Which used to coming Daily named WHMCS Cron JoB Activity Stopped.

 

That mail was so important as this mail always used to mail me which invoices created on the day. How many accounts to be suspended and all lot of Info. According to that info i used to suspend accounts and all , As i dont store My WHM user pass in WHMCS due to security issue.

 

This mail is so important to me. So can anyone tell how to set it up to work normally.

 

Or is there anywhere else i can see what cron job did for the day.

 

Thanx in Advance for a Positive Reply.

 

Regards

Edited by prem101
Link to comment
Share on other sites

Hi Prem!,

 

You say:

 

Last week i changed my admin directory and made access to admin directory via a user password. Also in cron i specified the same admin directory.

 

The problem is your .htaccess file. You have added authentication to the admin directory. The cron job can not get to the cron.php file because of the authentication in .htaccess.

 

If you add this to your .htaccess file you should find a resolution to your problem:

 

<Files "cron.php">
Allow from All
Satisfy Any
</Files>

 

Hope this helps! Oh...also make sure that you have updated the cron job to correspond with the change to the admin directory name.

Edited by bubbasheeko
addition about the update to the cron.
Link to comment
Share on other sites

Thanx For Reply.

 

But the thing is Cron is running ok and invoices getting generated Daily. Only thing is i dont get the mail named "WHMCS Cron Job Activity" Which used to Come Daily Before 5 Days.

 

I Added your suggested code in .htaccess but still no luck. :(

 

Let me know how can i get back that Email Daily.

 

Regards

Link to comment
Share on other sites

In that case...I am experiencing the same issue. It doesn't always send the email generated by the cron after the update has completed. I got it the first day I set it up and I haven't received it since. So I have added:

 

php_value max_execution_time 400

php_value memory_limit 64M

 

to my .htaccess file in my whmcs directory. I ran cron.php by manually browsing to the file and it triggered my activity email.

 

By adding the max execution time to 400 it will allow for more time to complete the cron script. I also added the memory limit and set it to 64 M to ensure it was not a memory issue.

Edited by bubbasheeko
Link to comment
Share on other sites

hi prem,

 

Was there a number attached to that server error - ie. 500 - Internal Server Error?

 

As for the second question. You can see overdue accounts under the WHMCS Admin Summary section (the first screen you see when you log in) - Invoices - Overdue. If you click on the overdue link it brings you to the overdue invoices.

Link to comment
Share on other sites

Below are the .htaccess contents :

 

AuthType Basic

AuthUserFile "/home/hostindi/.htpasswds/public_html/billing/whmcsadmin/passwd"

require valid-user

<Files "cron.php">

Allow from All

Satisfy Any

</Files>

php_value max_execution_time 400

php_value memory_limit 64M

Link to comment
Share on other sites

Try removing the php_value's that I gave you from the .htaccess. Create a file called php.ini in the same directory as your .htaccess file. Your host most likely does not allow for the php_values in your .htaccess file. Add the following to the newly created php.ini file:

 

max_execution_time 400

memory_limit 64M

Link to comment
Share on other sites

New Error when i run cron manually in browser :

 

Site error: the file /home/hostindi/public_html/billing/whmcsadmin/cron.php requires the ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.

 

But ioncube loaders are installed on server.

 

Regards

Link to comment
Share on other sites

//edit

 

this occurred after I added

 

<Files "cron.php">

Allow from All

Satisfy Any

</Files>

to .htaccess

 

removing those lines eliminated the error in the shell but I still don't get backups

 

//end edit

 

Similar problem in that my backups stopped working - when I run

 

php -q /home/nmd/public_html/domains/admin/cron.php/

 

from the shell I get : Could not open input file: /home/xxx/public_html/xxxxx/admin/cron.php/

Edited by LeMarque
Link to comment
Share on other sites

cPanel did an update and changed the permission of the cron file.

I had to go in and change mine as soon as I realised.

If you log into your cPanel and click on cron it incorrect it will give you a message there to change perms to 4755

I did that and it still isn't sent. The system is still sending invoices, but the cron isn't being shown in the Activity Log as being run since December 29 (the day I upgraded to 3.8.1).

Edited by Shimmy
Link to comment
Share on other sites

  • 4 months later...

php_value max_execution_time 400

 

You saved my life. I have had this problem for about 9 months and couldn't for the life of me figure out why I don't get confirmation e-mails for the cron.php. When I eventually figured it cron.php works if you run it multiple times did I change the memory_limit value instead of the max_execution_time value. I also mistakenly changed the Apache httpd one instead of the PHP CLI one. On Ubuntu you should change /etc/php5/cli/php.ini instead of /etc/php5/apache2/php.ini. My system is now very stable with Ubuntu.

 

Is there a way to change this on demand? Because I'm scared if I put it too long for other apps I might have to long for exit codes. But for now I am just very happy to have a confirmation e-mail again without having to manually run cron.php! Hurah!

 

FYI: My cron.php runs about 80 minutes before completion.

Link to comment
Share on other sites

There are various ways to change it on demand such as creating a "stub" php file called cron_starter.php with

ini_set('memory_limit', '256M');
ini_set('max_execution_time', '300');
require ('cron.php');

 

Got the tip above from here: http://forum.whmcs.com/showthread.php?t=16450&highlight=cron.php&page=2

 

This seems to be a good way to leave the php.ini value for PHP 5 on Ubuntu at default for max_execution_time which is 30 seconds, which I had to do on a shared server.

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated