Re: dl() problems with 4.2.0

From: Date: Mon, 06 May 2002 11:39:13 +0000
Subject: Re: dl() problems with 4.2.0
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-5327@lists.php.net to get a copy of this message
Markus Fischer wrote:
Can you and/or someone else please double verify this? - Markus OK here we go:
My system is Linux 2.2 (glibc 2.1.3), Apache 1.3.24, with PHP 4.2.0 loaded as DSO. $ ls -la /usr/local/bin/php-config --extension-dir total 58
drwxr-xr-x   2 root     root         1024 May  5 17:28 .
drwxr-xr-x   5 root     root         1024 Apr 16 13:04 ..
-rwxr-xr-x   1 root     root        56186 May  5 17:35 rrdtool.so
Ok, so now we run the following PHP script: <?php dl("rrdtool.so"); ?> And we get: Warning: Unable to load dynamic library './rrdtool.so' - ./rrdtool.so: cannot open shared object file: No such file or directory in /path/to/test.php on line 1 Right, so let's try putting this in (/usr/local/bin/php-config --extension-dir is /usr/local/lib/php/extensions/no-debug-non-zts-20010901): <?php dl("/usr/local/lib/php/extensions/no-debug-non-zts-20010901/rrdtool.so"); ?> Returns: Warning: Unable to load dynamic library './/usr/local/lib/php/extensions/no-debug-non-zts-20010901/rrdtool.so' - .//usr/local/lib/php/extensions/no-debug-non-zts- 20010901/rrdtool.so: cannot open shared object file: No such file or directory in /path/to/test.php on line 1 Finally we do: cp /usr/local/bin/php-config --extension-dir/rrdtool.so ./ And it all works successfully. I've only tried this with rrdtool.so - so it could *concievably* be rrdtool.so not finding another SO - if so the error message given is a little cryptic. However, I doubt this is the case due to the "./" appended to the path by dl(). Russ Garrett (russ@garrett.co.uk)

« previous php.qa (#5327) next »