From:             pkwan at advsofteng dot net
Operating system: All
PHP version:      5.3.0
PHP Bug Type:     Scripting Engine problem
Bug description:  dl is incorrect disabled in CGI context

Description:
------------
According to the PHP documentation, the "dl" function is deprecated, but
not disabled. So it should continue to work. However, it is disabled if the
PHP is run in CGI context.

The followings are the supporting documentation as published in
http://www.php.net/dl

- 5.3.0 This function now throws an E_DEPRECATED notice on all sapi's
except for CLI, CGI and Embed.  

- As of PHP 5, the dl() function is deprecated in every SAPI except CLI.
Use Extension Loading Directives method instead. 

- Since PHP 6 this function is disabled in all SAPIs, except CLI, CGI
and embed. 

The above means "dl" is disabled in some SAPI only starting from PHP 6.
Even in PHP 6, "dl" should continue to work in CLI, CGI and embed.

In PHP 5, "dl" is deprecated but not disabled. It should work in CLI,
CGI, Embed, and at most throws a E_DEPRECATED notice in other SAPI.

In practice, "dl" does not work in CGI, and no E_DEPRECATED notice is
throw in any case. After some trouble-shooting, the code that causes the
problem is (located in cgi_main.c):

if (!cgi && !fastcgi && !bindpath) {
   cgi_sapi_module.additional_functions = additional_functions;
}

The "cgi-main.c" detects that it is actually run as CGI (by detecting the
server environmental variables), it will disables the "dl" function in CGI
usage, conflicting with the documentation.


Reproduce code:
---------------
<?php dl("any_name.dll"); ?>

**** NOTE ****: You can reproduce the problem by actually using php-cgi in
CGI. You cannot reproduce the problem if you just run php-cgi from the
command line. The php-cgi will check for the server environmental variables
to detect if it is actually running as CGI, and will disable "dl" only if
it is actually running as CGI.

Expected result:
----------------
If the above code is executed in CGI, no error message is expected. 


Actual result:
--------------
Fatal error: Call to undefined function dl() in
C:\Inetpub\Scripts\phpinfo.php on line 1



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

Reply via email to