PHP 5.3+ enable_dl not include dl ()?

I am trying to install a third-party PHP extension (.so) in PHP 5.3.6-13 on Ubuntu 11.10 and use it in a web environment. The vendor documentation suggests using the dl() function to dynamically load the library.

When I try to execute my sample code, I find that dl() not available (Fatal error: call to undefined function dl ()), because the dl() function is deprecated in PHP 5.3. But there is an enable_dl configuration rule in php.ini, and other sources say that I should use dl () by simply changing the php.ini variables ( enable_dl=On , safe_mode=Off , not specified in disable_functions ) and restarting apache. When I try to do this, dl() is still undefined.

So, I go into the PHP 5.3 SAPI change notes and find this:

The dl () function is now disabled by default and is now available only in the CLI, CGI and embeds SAPI.

Does this mean that dl() not only "disabled by default" in PHP 5.3+ using web-based SAPI, but actually "completely unavailable no matter what I do, even when changing PHP configuration settings" ? This is what it seems to me, since I cannot get dl() to work no matter what I configure.

To clarify: I can change php.ini and download the extension directly, so it’s not a question of how to make the extension work, but of the dl() function and its state in PHP 5.3+. If it is no longer available under any circumstances, I want to inform the supplier so that they can update their documentation. But if it should be accessible, and I just missed something, I would also like to hear it.

+7
source share
1 answer

This feature has been removed from some SAPIs in PHP 5.3. - dl()

So, if you have the ini enable_dl parameter enable_dl to on and it still does not work, then it is disabled in the SAPI used.

If you are wondering about which SAPIs are intended, then the change log on the same page in more detail:

The only SAPIs that allow dl() are the CLI and Embed.

You are not using either of these two. Instead, use the Extension Download Directives , and you're fine.

+3
source

All Articles