#42511 [Fbk->Opn]: When using the CGI SAPI, Zend Extensions fail to load

2007-09-03 Thread schneecrash+php at gmail dot com
 ID:   42511
 User updated by:  schneecrash+php at gmail dot com
 Reported By:  schneecrash+php at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: CGI related
 Operating System: OSX, FreeBSD, Linux
 PHP Version:  5CVS-2007-09-01 (CVS)
 New Comment:

good point.

php was configured with,

 ...
 --with-config-file-path=/usr/local/etc/php/
 ...

checking,

 cd /usr/local/etc/php//
 ls -al *.ini
   -rw-r- 1 root sc 7552 2007-08-31 11:07 php-apache2handler.ini
   -rw-r- 1 root sc 7552 2007-08-31 11:07 php-cgi.ini
   -rw-r- 1 root sc 7552 2007-08-31 11:07 php-cli.ini

note, that, atm, they're identical,

 diff php-cli.ini php-cgi.ini 
 (empty)

and, in each,

 egrep -i "zend_extension_ts" *.ini | egrep -i "xdebug|eacc"
  
php-apache2handler.ini:zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
  
php-apache2handler.ini:zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/xdebug.so"
  
php-cgi.ini:zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
  
php-cgi.ini:zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/xdebug.so"
  
php-cli.ini:zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
  
php-cli.ini:zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/xdebug.so"

then,

 cat info.php
   

 php info.php | grep Loaded
   Loaded Configuration File => /usr/local/etc/php/php-cli.ini

 php-cgi info.php | grep Loaded
   Loaded Configuration File (none) 


hm.  "php-cgi.ini" is NOT loading, now.  that'd explain why the
extension's not loading.

also,

   php -m php-cgi -m
   
   [PHP Modules]  [PHP Modules]
   bcmath cgi-fcgi
   calendar   date
   clamav dba
   ctype  libxml
   curl   openssl
   date   pcre
   dbaPDO
   domReflection
   eAccelerator   session
   ftpSPL
   gd standard
   gettextxml
   hash   zlib
   json
   libxml [Zend Modules]
   magickwand
   mbstring
   mcrypt
   mhash
   mysql
   mysqli
   ncurses
   openssl
   pcre
   pdf
   PDO
   pdo_mysql
   pdo_sqlite
   posix
   readline
   Reflection
   session
   shmop
   SimpleXML
   snmp
   soap
   sockets
   SPL
   standard
   tokenizer
   xdebug
   xml
   xmlreader
   xmlrpc
   xmlwriter
   zlib
   
   [Zend Modules]
   Xdebug
   eAccelerator

*before* this patch was applied/integrated, php-cgi.ini had loaded
correctly when php-cgi was invoked.

something i've missed, or an issue in the code?

thx.


Previous Comments:


[2007-09-03 08:11:13] [EMAIL PROTECTED]

Check with short script like ' and find out what
php.ini (if any) is loaded. (first section contains the info!)

------------

[2007-09-01 18:03:21] schneecrash+php at gmail dot com

Description:

When using the CGI SAPI, Zend Extensions fail to load (and/or?) report
as loaded.

This issue was originally reported as a continuing comment to 

 "CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options"
  http://bugs.php.net/bug.php?id=42453

but that bug was closed nonetheless.



Reproduce code:
---
With CLI SAPI:

# php -v
PHP 5.2.5-dev (cli) (built: Aug 31 2007 08:33:23) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator,
by eAccelerator
with Xdebug v2.1.0-dev, Copyright (c) 2002, 2003, 2004, 2005, 2006,
2007, by Derick Rethans

With CGI SAPI:

# php-cgi -v
PHP 5.2.5-dev (cgi-fcgi) (built: Aug 31 2007 08:34:02)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies



Expected result:

same loading and report of loaded extensions in case of *both* php &
php-cgi



Actual result:
--
CLI SAPI loads & reports extensions, CLI SAPI does not





-- 
Edit this bug report at http://bugs.php.net/?id=42511&edit=1


#42511 [NEW]: When using the CGI SAPI, Zend Extensions fail to load

2007-09-01 Thread schneecrash+php at gmail dot com
From: schneecrash+php at gmail dot com
Operating system: OSX, FreeBSD, Linux
PHP version:  5CVS-2007-09-01 (CVS)
PHP Bug Type: CGI related
Bug description:  When using the CGI SAPI, Zend Extensions fail to load

Description:

When using the CGI SAPI, Zend Extensions fail to load (and/or?) report as
loaded.

This issue was originally reported as a continuing comment to 

 "CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options"
  http://bugs.php.net/bug.php?id=42453

but that bug was closed nonetheless.



Reproduce code:
---
With CLI SAPI:

# php -v
PHP 5.2.5-dev (cli) (built: Aug 31 2007 08:33:23) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator, by
eAccelerator
with Xdebug v2.1.0-dev, Copyright (c) 2002, 2003, 2004, 2005, 2006,
2007, by Derick Rethans

With CGI SAPI:

# php-cgi -v
PHP 5.2.5-dev (cgi-fcgi) (built: Aug 31 2007 08:34:02)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies



Expected result:

same loading and report of loaded extensions in case of *both* php &
php-cgi



Actual result:
--
CLI SAPI loads & reports extensions, CLI SAPI does not

-- 
Edit bug report at http://bugs.php.net/?id=42511&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42511&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42511&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42511&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42511&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42511&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42511&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42511&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42511&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42511&r=support
Expected behavior:http://bugs.php.net/fix.php?id=42511&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42511&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42511&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42511&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42511&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42511&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42511&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42511&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42511&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42511&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42511&r=mysqlcfg


#42453 [Com]: CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options

2007-08-29 Thread schneecrash+php at gmail dot com
 ID:   42453
 Comment by:   schneecrash+php at gmail dot com
 Reported By:  hans at parse dot nl
 Status:   Assigned
 Bug Type: CGI related
 Operating System: Linux
 PHP Version:  5.2.4RC3
 Assigned To:  dmitry
 New Comment:

after applying 'cgi_main.c.patch' from above to latest php52x-branch, i
see, 

 % php -v
PHP 5.2.4 (cli) (built: Aug 29 2007 18:13:08) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 
eAccelerator,
by eAccelerator
with Xdebug v2.1.0-dev, Copyright (c) 2002, 2003, 2004, 2005, 
2006,
2007, by Derick Rethans

as before for php(cli).

but for php(cgi), i now see,

 % php-cgi -v
PHP 5.2.4 (cgi-fcgi) (built: Aug 29 2007 18:13:31)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

where i do *not* get the,

  [23661] EACCELERATOR: PHP unclean shutdown

but i also am 'missing' the 

with eAccelerator ...
with Xdebug ...


where,

 % php -m | egrep -i "eaccelerator|xdebug"
eAccelerator
xdebug
Xdebug
eAccelerator

 % php-cgi -m | egrep -i "eaccelerator|xdebug"
(empty)


given,

 % egrep -i "eaccelerator|xdebug" php-cli.ini
 
zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
 
zend_extension_ts="/usr/local/lib/php/extensions/no-debug-zts-20060613/xdebug.so"

and,

  % diff -ur php-cgi.ini php-cli.ini  
  %


Previous Comments:


[2007-08-28 11:46:05] [EMAIL PROTECTED]

Dmitry, you can commit that patch..or if you don't have time, I can do
it. :)



[2007-08-28 11:31:55] [EMAIL PROTECTED]

I had a discussion with Dmitry a few weeks ago and got directed towards
an onexit handler for dealing with module cleanup since my issue was
aimed at MySQL on Win32.

If other people are having problems then it may be worth while patching
it, I've created a patch at
http://server.macvicar.net/patches/cgi_main.c.patch



[2007-08-28 09:14:20] hans at parse dot nl

Description:

The CGI SAPI initializes extensions through the regular MINIT/RINIT
functions, but lacks a call to php_request_shutdown() for proper
extension shutdown on some command line options. This is the case for
command line options -v, -i and -m, which call exit(0) without
requesting module/extension shutdown first.

The CLI SAPI *does* clean up nicely after -v/-i/-m and does not exhibit
this behavior.

Reproduce code:
---
With CGI SAPI:

# php-cgi -v
PHP 5.2.4RC3 (cgi-fcgi) (built: Aug 27 2007 16:51:33)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator,
by eAccelerator
[23661] EACCELERATOR: PHP unclean shutdown


With CLI SAPI:

# php -v
PHP 5.2.4RC3 (cli) (built: Aug 27 2007 16:51:49)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator,
by eAccelerator


Expected result:

nice clean shutdown through RSHUTDOWN/MSHUTDOWN.

Actual result:
--
exit(0) without shutting down modules/extensions





-- 
Edit this bug report at http://bugs.php.net/?id=42453&edit=1