Loading PHP Extensions

In PHP 5.2.5 (I believe), a change was made to dl() that requires extensions be installed from the extensions directory. I can’t find any info on php.net; is anyone here familiar with the specifics of that change that could direct me to some documentation?

You might find some useful nuggets of info by digging through the Migrating from PHP 5.2.x to PHP 5.3.x documentation.

I see that dl() is deprecated in 5.3 (and it’s disabled by default), but going to the change logs for 5.2.5 and beyond I don’t see the new requirement. :-/ Odd. You’d think it would be mentioned.


The Changes in SAPI modules page says “The dl() function is now disabled by default, and is now available only under the CLI, CGI, and embed SAPIs.”

The changelog for dl() also notes that the [url=“http://docs.php.net/manual/en/ini.core.php#ini.extension”]extension loading directives should be used instead.

Yup, I’ve seen all that, but nothing that says that extensions must be loaded from extension_dir as of 5.2.5. However, extensions like ionCube and SourceGuardian must be installed there for 5.2.5+ – and I’m just wanting to confirm the change. (I want to test for the appropriate PHP version when someone is using my scripts.)

It’s in these PHP developer meeting notes (Paris, November 11th and 12th, 2005) where the drive to [url=“http://www.php.net/~derick/meeting-notes.html#extension-upgrading”]upgrade extensions seems to originate.

There were also some 5.2.5 bug fixes to do with extension_dir that may have helped too.

As you’re no doubt finding, it’s tricky at best to wade through all of the info out there to narrow down to where such ideas began.

Ah! I’d seen the bug fixes several times, but it didn’t click for me before. Since dl() was changed in 5.2.5 to accept only filenames, there’s no way to specify a path to the user’s filespace. Thus, dl() will always refer to files in extension_dir.

Thanks for the nudge in the right area.