Jump to content

Cron Issues - Invoices Not Generating


leopard16

Recommended Posts

I am running v6.1.1 and noticed a few months back (best I could tell it was likely August or Septemer) my invoices were not being generated automatically. I am not sure but I think the problem is likely one of the many udpates provided by WHMCS. If I visit the clients profile page and select: Generate Due Invoices it will then generate and e-mail the client the invoice. So I recreated my cron jobs (which were working fine for several years) to make sure it was not a server setting.

 

I have read and followed these instructions: http://docs.whmcs.com/Invoicing_Issues

but am still having issues. I contacted my hosting company and they tell me my cron paths are correct for their server.

 

In the Invoicing Issues instructions it says this: If the cron still doesn't complete with the increased memory limit please ensure display_errors is enabled in the server's PHP configuration and enable the Setup > General Settings > Other tab > Display Errors option, then run the cron manually by visiting the cron.php file in your browser. You should now see an error output to the screen.

 

But when I visit the cron page directly it just shows a blank page with no errors. I don't know what should happen when I visit the cron page, but since there are no errors I can only wonder is this points to my issue.

 

As you know not being able to generate invoices is a major problem. Please help.

 

- - - Updated - - -

 

I should have provided the cron paths.

 

My server cron job looks like this:

18 3 * * * php -q /home/MYUSERNAME/public_html/WHMCSFOLDER/crons/cron.php

 

In WHMCS under automation settings I have this:

Create the following Cron Job using PHP: php -q /home/MYUSERNAME/public_html/WHMCSFOLDER/crons/cron.php

Create the following Cron Job using GET: GET http://www.MYDOMAIN.com/WHMCSFOLDER/crons/cron.php

 

According to my hosting company the php -q is a correct command. Hope these details help.

 

- - - Updated - - -

 

One last detail. As stated in the Invoicing Issues section: Utilities > Logs > Activity Log and ensure you see a number of entries beginning "Cron Job" each day.

 

There are no cron jobs listed in the activity log.

Link to comment
Share on other sites

So you only see a blank page when you try to run the cron job manually?

Which attribute does cron.php have ? If 644 try to change it to 755.

Otherwise I recommend that you move the cron dir outside the public_html dir

( http://docs.whmcs.com/Further_Security_Steps )

 

I don't know about running the cron job manually, but I open cron job file location in my browser: http://www.MYDOMAIN.com/WHMCSFOLDER/crons/cron.php and when I do all I see it a blank page. I did change the file from 644 to 755 and I still see a blank page when I go to the cron file in my browser.

Link to comment
Share on other sites

Try to enable Display Errors and run it in your browser again.

If you still see a blank page, login to your server and run cron.php as the following:

 

php -q /home/yourname/public_html/WHMCSFOLDER/crons/cron.php debug

 

This should view data so you can see what is going on.

Link to comment
Share on other sites

OK. I enabled Display Errors and ran it it my browser again. No errors show on the cron page. When I look at the source code of my cron.php page in the browser the code is blank.

 

However, when I type the cron.php URL into the browser manually it does appear the cron.php page is runningthe tasks (its just not showing PHP debugging error like it should). Now, I can see in my WHMCS logs all the cron activities are running plus all my overdue invoices are now being generated.

 

So at least when I manually enter the cron.php file into my browser, it does seem to be properly executing my crons. But I am not sure (unless I wait a few days) if the cron setup is running this cron file or if these crons were all the manual attempts I made the past few days.

 

Should I try and re-upload my cron folder from my latest WHMCS update to make sure none of the cron files are corrrupt? Maybe during one of these updates one of my cron files became corrupted. It seems as if my server settings are proper, it seems as if my settings in WHMCS are proper, yet my cron.php file does not seem to be actived by my servers cron job which has the proper path according to my host.

 

- - - Updated - - -

 

My hosting company has a ticket created to see how I can enter the debug line you provided. Should I create a new cron or just add the debug to the back of the cron I already have set up?

 

Where will the debug file be shown? I am running CPanel.

Link to comment
Share on other sites

You login in to the server via SSH and enter the following at the command line:

php -q /home/yourname/public_html/WHMCSFOLDER/crons/cron.php debug

 

When the cron.php run, you see on the screen what happens.

 

It is important that the cron job ends with "Cron Job: Completed".

 

Otherwise, as I said, I recommend that you move the cron dir outside public_html, so that not just anyone can run cron jobs.

Link to comment
Share on other sites

I ran this and I am getting the error related to modules/servers/cpanel/cpanel.php

 

seriously.. I am looking at selling my license because of this insanity.. how the hell can I run a business when your software does not work.

 

At this point I am looking at moving to the competition ASAP.

 

 

PHP Warning: Illegal string offset 'DOMAIN' in /home/small/public_html/clients/

modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKUSED' in /home/small/public_html/client

s/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKLIMIT' in /home/small/public_html/clien

ts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DOMAIN' in /home/small/public_html/clients/

modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKUSED' in /home/small/public_html/client

s/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKLIMIT' in /home/small/public_html/clien

ts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'LIMIT' in /home/small/public_html/clients/m

odules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'LIMIT' in /home/small/public_html/clients/m

odules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'LIMIT' in /home/small/public_html/clients/m

odules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'LIMIT' in /home/small/public_html/clients/m

odules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DOMAIN' in /home/small/public_html/clients/

modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKUSED' in /home/small/public_html/client

s/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKLIMIT' in /home/small/public_html/clien

ts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DOMAIN' in /home/small/public_html/clients/

modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKUSED' in /home/small/public_html/client

s/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'DISKLIMIT' in /home/small/public_html/clien

ts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'LIMIT' in /home/small/public_html/clients/m

odules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'LIMIT' in /home/small/public_html/clients/m

odules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'LIMIT' in /home/small/public_html/clients/m

odules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'MAINDOMAIN' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

PHP Warning: Illegal string offset 'TOTALBYTES' in /home/small/public_html/clie

nts/modules/servers/cpanel/cpanel.php on line 0

 

and does it matter where the damned cron dir is if you use an htaccess file to restrict access? seriously get with the program and restrict access to the dir.

Link to comment
Share on other sites

OK my issue has been resolved. The problem for me is my PHP version on the cron did not match the PHP version on my server. Here is my hosting companies response to my issue:

 

"Looking through the cron logs it appears that your cron is running reliably, but testing the cron I have found that it is not compatible with php 5.4, so I have updated the cron job to run with php 5.3 as follows:

/opt/php53/bin/php -q /home/yourname/public_html/WHMCSFOLDER/crons/cron.php

 

Additionally the path variable needed to be corrected at /home/yourname/public_html/WHMCSFOLDER/crons/config.php

 

You may want to ensure that WHMCS is up to date on the most recent version so that it is compatible with more recent versions of PHP."

 

I don't know when or how my PHP version and the WHMCS became uncompatible but it must have been during one of the recent updates within the past few months. This is when it broke. Anyway all is well now. I hope this helps others with the same issue!

Link to comment
Share on other sites

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