PHP and DL()
The problem
I’ve tryied to execute a php script containing a dl() call to a .so from the command line and I’ve got the message:
Warning: dl(): Dynamically loaded extensions aren't enabled in /home/roberto/tmp/helloworld.php on line 6
The cause
The web host has not enabled dynamically loaded extensions.
The solution
I asked to the php interpreter where to find the configuration:
php --ini Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files in: /etc/php5/cli/conf.d ...
So with a simple sudo vi /etc/php5/cli/php.ini I changed the parameter enable_dl=Off to enable_dl=On.
Enjoy,
Rob.
Tags: php ubuntu



