I am trying to install a 3rd party PHP extension (.so) into PHP 5.3.6-13 on Ubuntu 11.10 and use it in a web environment. The vendor's documentation suggests using the dl()
function to dynamically load the library.
When I try their example code, I find the dl()
isn't available (Fatal error: call to undefined function dl()) as dl()
function was deprecated in PHP 5.3. But there is an enable_dl
config rule in php.ini, and other sources say that I should be able to use dl() simply by changing the php.ini variables (enable_dl=On
, safe_mode=Off
, not listed in disable_functions
) and restarting apache. When I try that, dl()
is still undefined.
So I dig into the PHP 5.3 SAPI change notes and find this:
The dl() function is now disabled by default, and is now available only under the CLI, CGI, and embed SAPIs.
Does this mean that dl()
is not only "disabled by default" in PHP 5.3+ using a web SAPI, but actually "completely unavailable no matter what I do even with modifying PHP config options"? That's what it appears to me to be since I can't get dl()
to work no matter what I tweak.
To clarify: I can modify php.ini and load the extension directly, so this is not a question about how to get the extension working, rather about the function dl()
and its state in PHP 5.3+. If it's no longer available under any circumstance I want to be able to tell the vendor, so they can update their documentation. But if it should be available and I'm just missing something, I'd like to hear that too.
dl()
has been disabled for security reasons. You do not want to have new stuff loaded in the process context of your webserver ;) - Or better :( in your case, because you will not get it to work. Howver as you can edit the ini file, you can just load the extension – Part