ID: 22796 Updated by: [EMAIL PROTECTED] Reported By: gk at proliberty dot com Status: Feedback Bug Type: CGI related Operating System: linux RH 7.2 PHP Version: 4CVS-2003-03-19 (stable) New Comment:
And get first the latest stable snapshot again. Previous Comments: ------------------------------------------------------------------------ [2003-03-24 04:11:54] [EMAIL PROTECTED] # php -r "f();" Command line code(1) : Fatal error - Call to undefined function: f() This is what I get when using the php.ini-dist from the latest stable CVS snapshot. As you can see, we get totally different style of error messages too. Please try with the plain, unmodified php.ini-dist instead of your current php.ini. ------------------------------------------------------------------------ [2003-03-24 02:11:34] gk at proliberty dot com I split this bug into two; changed the title to better reflect what I have learned: it is possible to work around this bug by changing the default value of display_startup_errors in php.ini: --- #default value #display_startup_errors = Off display_startup_errors = On --- Now I get the proper error message: [EMAIL PROTECTED] php4-STABLE-200303210630]# sapi/cli/php -r "f();" Fatal error: Call to undefined function: f() in Command line code on line Following sniper's advice of using -n to prevent reading php.ini has the same effect for me as display_startup_errors = Off; apparently it doesn't have the same result for sniper. Odd. ------------------------------------------------------------------------ [2003-03-21 20:09:38] gk at proliberty dot com I built it again, per your instructions and get the same result: [EMAIL PROTECTED] php4-STABLE-200303210630]# sapi/cli/php -n -r "require('/htdocs/common/test/junk/junk.php');" begin [EMAIL PROTECTED] php4-STABLE-200303210630]# Do I need a more recent snapshot than that? I'm using the same test file: /htdocs/common/test/junk/junk.php: <?php echo "begin\n"; f(); // undefined function; fatal error echo "end\n"; ?> ------------------------------------------------------------------------ [2003-03-21 17:13:42] [EMAIL PROTECTED] Try this with latest stable snapshot: # rm config.cache # ./configure --disable-all --disable-cgi && make clean && make # sapi/cli/php -n -r "require('test.php');" I think you're just doing something wrong / have something setup very differently in your server.. ------------------------------------------------------------------------ [2003-03-21 13:42:24] gk at proliberty dot com I have tried your suggestion same test file and with: php4-STABLE-200303210630 (March 21) I get the same results: [EMAIL PROTECTED] junk]$ php -n -r 'require("junk.php");' begin [EMAIL PROTECTED] junk]$ php -r 'require("junk.php");' begin [EMAIL PROTECTED] junk]$ php junk.php begin Fatal error: Call to undefined function: f() in /usr/local/apache/htdocs/common/test/junk/junk.php on line 3 [EMAIL PROTECTED] junk]$ Perhaps the difference is in our configure options. Mine are: ./configure --with-dom --with-zlib-dir=/usr/include --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs --with-xml --enable-track-vars Please let me know if we need to split this but into two: have you tested the issue of error messages not going to /dev/stderr or only the -r issue? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22796 -- Edit this bug report at http://bugs.php.net/?id=22796&edit=1