lodlock Posted October 10, 2007 Share Posted October 10, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/72689-php-command-line-problems/ Share on other sites More sharing options...
SammyGunnz Posted October 11, 2007 Share Posted October 11, 2007 Those are notices/warnings, not errors. Edit your php.ini file and change the error_reporting level to... error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT Quote Link to comment https://forums.phpfreaks.com/topic/72689-php-command-line-problems/#findComment-366622 Share on other sites More sharing options...
btherl Posted October 11, 2007 Share Posted October 11, 2007 Can you post your header.inc.php ? Quote Link to comment https://forums.phpfreaks.com/topic/72689-php-command-line-problems/#findComment-366645 Share on other sites More sharing options...
trq Posted October 11, 2007 Share Posted October 11, 2007 Also, because your calling this script via cron it executes from the same directory as cron. I'm not sure if you are already or not but your call to require_once needs a full path to the script. A relative path will not work from cron. Quote Link to comment https://forums.phpfreaks.com/topic/72689-php-command-line-problems/#findComment-366693 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.