Jump to content

PHP command line problems


lodlock

Recommended Posts

I am been using a script by Boonex for a while now and havn't had any troubles until I updated to openSuSE 10.3. Ever since then when a cron job'd:

/usr/bin/php -q /path_to/notifies.php

 

returns an error of:

PHP Notice:  Use of undefined constant BX_DIRECTORY_PATH_INC - assumed 'BX_DIRECTORY_PATH_INC' in /path_to/notifies.php on line 24

PHP Warning:  require_once(BX_DIRECTORY_PATH_INCdb.inc.php): failed to open stream: No such file or directory in /path_to/notifies.php on line 24

PHP Fatal error:  require_once(): Failed opening required 'BX_DIRECTORY_PATH_INCdb.inc.php' (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /path_to/notifies.php on line 24

 

The specific lines that it is complaining about are:

require_once( '/path_to/header.inc.php' );
[b]require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' );[/b]

 

Now the BX_DIRECTORY_PATH_INC is declared in the header.inc.php file. So in such it appears that it isn't actually passing declarations from the first require_once.

 

My php -v returns:

PHP 5.2.4 with Suhosin-Patch 0.9.6.2 (cli) (built: Sep 22 2007 02:01:31)

Copyright © 1997-2007 The PHP Group

Zend Engine v2.2.0, Copyright © 1998-2007 Zend Technologies

 

Now i'm not sure if php used to be a cgi install but now is a cli, unfortunately I do not recall.

 

I am not sure if the php-cgi command runs is the same as if i compiled php as a cgi instead of cli but if i run:

/usr/bin/php-cgi -q /path_to/notifies.php 

it just returns the source code of the php file and doesn't actually do anything.

 

I have been searching the internet for a while now as to either this issue or varying version differences that might have caused this issue but to no avail.

 

Any assistance in this matter would be greatly appreciated,

 

-Lodlock

Link to comment
https://forums.phpfreaks.com/topic/72689-php-command-line-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.