davida50000 Posted March 17, 2011 Share Posted March 17, 2011 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! 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 17, 2011 Share Posted March 17, 2011 What did the instructions say about setting up the cron job? Did it say just use the path, or did you also need to use something with it in the cron, like "/usr/bin/php path/to/script"? 0 Quote Link to comment Share on other sites More sharing options...
davida50000 Posted March 18, 2011 Author Share Posted March 18, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 18, 2011 Share Posted March 18, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
davida50000 Posted March 18, 2011 Author Share Posted March 18, 2011 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 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.