php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42511 When using the CGI SAPI, Zend Extensions fail to load
Submitted: 2007-09-01 18:03 UTC Modified: 2007-09-12 01:00 UTC
From: schneecrash+php at gmail dot com Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5CVS-2007-09-01 (CVS) OS: OSX, FreeBSD, Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
29 - 21 = ?
Subscribe to this entry?

 
 [2007-09-01 18:03 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-03 08:11 UTC] jani@php.net
Check with short script like '<?php phpinfo(); ?> and find out what php.ini (if any) is loaded. (first section contains the info!)
 [2007-09-03 16:34 UTC] schneecrash+php at gmail dot com
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 phpinfo(); ?>

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

 php-cgi info.php | grep Loaded
   <tr><td class="e">Loaded Configuration File </td><td class="v">(none) </td></tr>


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
   dba            PDO
   dom            Reflection
   eAccelerator   session
   ftp            SPL
   gd             standard
   gettext        xml
   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.
 [2007-09-04 10:27 UTC] jani@php.net
Did you compile CGI with --enable-fastcgi? As in that case, the correct name for your php.ini file for it is: php-cgi-fcgi.ini

Try this script:

<?php 
echo PHP_SAPI, "\n";
echo php_ini_loaded_file(), "\n";
?>

AFAICT, the patch you claim broke this has nothing to do with it.
 [2007-09-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 08:01:32 2024 UTC