Jump to content

Free Trial Module Cron Job Error Help


Recommended Posts

http://www.whmcs.com/members/communityaddons.php?action=viewmod&id=36&vote=true

 

I am using the above Trial Module, i used it in the past before my servers HDD failed and i had to start again.

 

In order to make this work i needed to run 2 cron jobs, however when they run there appears to be errors.

 

Any help would be much appreciated!

 

Here is the errors i receive:

 

1st Cron Job:

 

/home/****/public_html/clients/modules/freetrial/remindtrial.php: line 1: ?php: No such file or directory

/home/****/public_html/clients/modules/freetrial/remindtrial.php: line 3: //: is a directory

/home/****/public_html/clients/modules/freetrial/remindtrial.php: line 4: syntax error near unexpected token `"../../dbconnect.php"'

/home/****/public_html/clients/modules/freetrial/remindtrial.php: line 4: `require("../../dbconnect.php");'

 

2nd Cron Job:

 

/home/****/public_html/clients/modules/freetrial/removetrial.php: line 1: ?php: No such file or directory

/home/****/public_html/clients/modules/freetrial/removetrial.php: line 3: //: is a directory

/home/****/public_html/clients/modules/freetrial/removetrial.php: line 4: syntax error near unexpected token `"../../dbconnect.php"'

/home/****/public_html/clients/modules/freetrial/removetrial.php: line 4: `require("../../dbconnect.php");'

 

When you try to visit either php page directly you get an internal server error, here is mine for example:

 

http://www.hydrode.com/clients/modules/freetrial/removetrial.php

 

Like i said, any help is much appreciated!

Link to comment
Share on other sites

It doesnt actually say anything like that, the only cron job info i get is:

 

5) You will need to set 2 cron jobs: one for remindtrial.php (which sends reminders before the free trial ends for each account) and removetrial.php (removes accounts whose trial periods have expired.

Link to comment
Share on other sites

Have you tried changing the path in the scripts to hard coded values? It's possible the cron isn't traversing directories properly using relative addressing (IE: ../../)

Change paths to suit:

require("/home/user/public_html/whmcs/dbconnect.php");

 

This part is also puzzling:

?php: No such file or directory

Is it not reading the script start properly? Does that begin in your copy with <?php, or just ?php...?

 

Before doing anything else, try adding something to the start of the cron that calls the PHP interpreter.

Link to comment
Share on other sites

Not the most technical person so you may need to help me out a bit ;) Thanks so far for the quick responses and help though!

 

I changed the path to: require("/home/user/public_html/whmcs/dbconnect.php");

 

I tried

root@NL-001 [~]# /home/hydrode/public_html/clients/modules/freetrial/removetrial.php

/home/hydrode/public_html/clients/modules/freetrial/removetrial.php: line 1: ?php: No such file or directory

/home/hydrode/public_html/clients/modules/freetrial/removetrial.php: line 3: //: is a directory

/home/hydrode/public_html/clients/modules/freetrial/removetrial.php: line 4: syntax error near unexpected token `"/home/user/public_html/whmcs/dbconnect.php"'

/home/hydrode/public_html/clients/modules/freetrial/removetrial.php: line 4: `require("/home/user/public_html/whmcs/dbconnect.php");'

 

Then i tried:

root@NL-001 [~]# php -q /home/hydrode/public_html/clients/modules/freetrial/removetrial.php

 

Warning: require(): URL file-access is disabled in the server configuration in /home/hydrode/public_html/clients/modules/freetrial/removetrial.php on line 4

 

Warning: require(http://www.hydrode.com/clients/dbconnect.php): failed to open stream: no suitable wrapper could be found in /home/hydrode/public_html/clients/modules/freetrial/removetrial.php on line 4

 

Fatal error: require(): Failed opening required 'http://www.hydrode.com/clients/dbconnect.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hydrode/public_html/clients/modules/freetrial/removetrial.php on line 4

root@NL-001 [~]# php -q /home/hydrode/public_html/clients/modules/freetrial/removetrial.php

 

Warning: require(/home/user/public_html/whmcs/dbconnect.php): failed to open stream: No such file or directory in /home/hydrode/public_html/clients/modules/freetrial/removetrial.php on line 4

 

Fatal error: require(): Failed opening required '/home/user/public_html/whmcs/dbconnect.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/hydrode/public_html/clients/modules/freetrial/removetrial.php on line 4

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