stiez / pos-tracker-eve

Automatically exported from code.google.com/p/pos-tracker-eve
0 stars 0 forks source link

Cron Jobs #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi 

When i run Cron Jobs i m get some errors and they are as followed:

Output from command /usr/bin/php /var/www/xxxxx/httpdocs/pos/cron_updatepos.php 
..

PHP Fatal error:  Call to undefined function ADONewConnection() in 
/var/www/xxxxxxx/httpdocs/pos/includes/dbfunctions.php on line 70

Output from command /bin/sh /var/www/xxxxxxxx/httpdocs/pos/poscron.sh ..

/var/www/xxxxxxxx/httpdocs/pos/poscron.sh: line 3: cd: 
/var/www/xxxxxxx/httpdocs/pos
: No such file or directory
Could not open input file: cron_updatepos.php
/var/www/xxxxxxxx/httpdocs/pos/poscron.sh: line 6: 
: command not found

Output from command /bin/sh /var/www/xxxxxxxx/httpdocs/pos/postrackercron.sh ..

Could not open input file: 
/var/www/xxxxxxxx/httpdocs/pos/cron_updateallianceinfo.php
Could not open input file: /var/www/xxxxxxxxk/httpdocs/pos/cron_updatesov.php

Any Help would be great

Original issue reported on code.google.com by Steve.ch...@gmail.com on 17 Mar 2012 at 2:08

GoogleCodeExporter commented 9 years ago
That means your cron jobs aren't running in php 5.2.x or higher. Probably 
running on 4.x.x. You'll need to direct the cron job to the right php version.

/usr/bin/php is your version 4

/usr/bin/php5 could be your version 5. It really depends on how the server was 
setup. If you ask your host they can usually tell you where they put it.

Original comment by frozenic...@gmail.com on 17 Mar 2012 at 6:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
i have php 5.3.3 

when i do the whereis php5 it dont give me any info as were whereis php gives 
me /usr/bin/php

Original comment by Steve.ch...@gmail.com on 17 Mar 2012 at 11:24

GoogleCodeExporter commented 9 years ago
Glad I checked this. Same config, same Error message. 

.../php .../cron_updatepos.php
PHP Fatal error:  Call to undefined function ADONewConnection() in 
.../includes/dbfunctions.php on line 70

When I run .../php -v I get the following output:

.../php -v
PHP 5.3.3 (cli) (built: Feb 22 2012 19:38:14)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

64 bit CentOS 5.7. When I manually update everything is tidy. It may be related 
to permissions from the .tar.gz file, which were rather borked when I extracted 
server-side.

Original comment by MMit...@gmail.com on 19 Mar 2012 at 12:57

GoogleCodeExporter commented 9 years ago
I had this problem as well, but I noticed something when I tried to run the 
script as a program, outside of SH:

./poscron.sh
bash: ./poscron.sh: /bin/sh^M: bad interpreter: No such file or directory

It seems these files are in dos format, and don't play well with *nix. Find the 
package "dos2unix" and run it on the file:

> dos2unix poscron.sh
dos2unix: converting file poscron.sh to UNIX format ...

Also, try setting your complete path for your jobs, ie:

/usr/bin/php /var/www/html/eve/pos/cron_updatesov.php

Now try to run your script. You may see this message: 
PHP Warning:  Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater 
in Unknown on line 0

but it can be safely ignored, as it's just a notification message of obsoleted 
variables. 

Original comment by shadow...@gmail.com on 19 Mar 2012 at 7:22

GoogleCodeExporter commented 9 years ago
On that note I may just mv the files and manually rewrite the .sh scripts 
though I expect the same failures. It may be some odd missing dependency that 
is buried in CentOS.

As with any shell scripts absolute paths are a must. The ...'s were simply me 
not listing the entire path on my server.

Original comment by MMit...@gmail.com on 19 Mar 2012 at 12:10

GoogleCodeExporter commented 9 years ago
Permissions, Permissions, Permissions.

The following files need to be set to chmod 755:

cron_mail.php
cron_updateallianceinfo.php
cron_updatejobs.php
cron_updatepos.php
cron_updatesov.php

This one can be closed. User solved. Keep the good tool going Frozen Guardian, 
because it keeps our hunger fed.

Original comment by MMit...@gmail.com on 19 Mar 2012 at 12:23

GoogleCodeExporter commented 9 years ago
Still no joy with this it worked on the old server and nothing is diff 

same errors

Original comment by Steve.ch...@gmail.com on 20 Mar 2012 at 11:23

GoogleCodeExporter commented 9 years ago
when i run one of the php files i get this 

Output from command /usr/bin/php 
/var/www/........../httpdocs/pos/cron_updatepos.php ..

PHP Fatal error:  Call to undefined function ADONewConnection() in 
/var/www/....../httpdocs/pos/includes/dbfunctions.php on line 70

Any help on how to fix this issue

Original comment by Steve.ch...@gmail.com on 20 Mar 2012 at 11:41

GoogleCodeExporter commented 9 years ago
So I think I chased this bug down. It seems that the cron script only wants to 
work when run from the root directory of postracker. So that line in the .sh 
script that is commented out? Un-comment it and have it cd to your postracker 
directory. From there have your cron jobs point instead to said .sh scripts, 
making sure that they are executable, etc, etc. I don't think every system is 
as fussy, but its seems CentOS is.

This has worked for me thus far, let me know if it flies for you.

Original comment by MMit...@gmail.com on 22 Mar 2012 at 11:24