ID:               48845
 Updated by:       [email protected]
 Reported By:      pkwan at advsofteng dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: All
 PHP Version:      5.3.0
 New Comment:

Do not report twice the same bug.


Previous Comments:
------------------------------------------------------------------------

[2009-07-08 06:51:58] pkwan at advsofteng dot net

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 this bug report at http://bugs.php.net/?id=48845&edit=1

Reply via email to