Can't find PHP Extensions Directory

snowweb

Verified User
Joined
Aug 31, 2007
Messages
144
Location
Antipolo City, Rizal, Philippines (a British Natio
I'm trying to install NuSphere's PhpExpress .so and need to put it in the PHP extensions directory.

I know that it is claimed that the directory is stated in the php.ini but in my php.ini is is stated as just "./" which to me means, on back from where I currently am! Since php.ini is in /usr/local/lib/ that means just dropping it into /usr/local/ which doesn't sound right. I was expecting to see a proper directory path and name!

Please can some one tell me where I should be looking?

Thanks guys :)

pete
 
You can change extension dir to "" if you want, then you will need to specify a full path to the extension.
 
I think you are talking about:
Code:
/usr/local/bin/php-config --extension-dir
 
I think you are talking about:
Code:
/usr/local/bin/php-config --extension-dir

Ok, the file /usr/local/bin/php-config (I don't understand the --extension-dir, so ignored it for now) seems to have the following line in it (along with much else). Could that be the full path to the extension directory?

extension_dir='/usr/local/lib/php/extensions/no-debug-non-zts-20060613'

If so, if I put an extension in it will it work for all users (since I notice that it has 'usr' in the path?

Also, do I put it in the directory called 'no-debug-non-zts-20060613' or in the one called 'extensions' please?

Kind regards

peter
 
Yes, you are right.
Code:
/usr/local/bin/php-config --extension-dir
Just shows the same line that you found by executing "/usr/local/bin/php-config".

Extension needs to be in /usr/local/lib/php/extensions/no-debug-non-zts-20060613. E.g. if you have /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ext.so extension, extension="ext.so" will load it.
 
Yes, you are right.
Code:
/usr/local/bin/php-config --extension-dir
Just shows the same line that you found by executing "/usr/local/bin/php-config".

Extension needs to be in /usr/local/lib/php/extensions/no-debug-non-zts-20060613. E.g. if you have /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ext.so extension, extension="ext.so" will load it.

Cheers for that buddy... i owe you one!

pete
 
Yes, you are right.
Code:
/usr/local/bin/php-config --extension-dir
Just shows the same line that you found by executing "/usr/local/bin/php-config".

Extension needs to be in /usr/local/lib/php/extensions/no-debug-non-zts-20060613. E.g. if you have /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ext.so extension, extension="ext.so" will load it.

After all that, the actual directory doesn't seem to exist at the stated path!

This is what I have:

[root@s1 /]# cd /usr/local/lib/php/
[root@s1 php]# ls -a -l -sF
total 140
4 drwxr-xr-x 13 root root 4096 May 31 17:48 ./
4 drwxr-xr-x 6 root root 4096 Jun 2 14:49 ../
4 drwxr-xr-x 2 root root 4096 May 31 17:48 Archive/
4 drwxr-xr-x 2 root root 4096 May 31 17:48 build/
4 drwxr-xr-x 3 root root 4096 May 31 17:48 .channels/
4 drwxr-xr-x 2 root root 4096 May 31 17:48 Console/
4 drwxr-xr-x 4 root root 4096 May 31 17:48 data/
4 -rw-r--r-- 1 root root 2459 May 31 17:48 .depdb
0 -rw-r--r-- 1 root root 0 May 31 17:48 .depdblock
4 drwxr-xr-x 5 root root 4096 May 31 17:48 doc/
8 -rw-r--r-- 1 root root 7134 May 31 17:48 .filemap
0 -rw-r--r-- 1 root root 0 May 31 17:48 .lock
4 drwxr-xr-x 2 root root 4096 May 31 17:48 OS/
4 drwxr-xr-x 11 root root 4096 May 31 17:48 PEAR/
16 -rw-r--r-- 1 root root 15410 May 31 17:48 pearcmd.php
36 -rw-r--r-- 1 root root 34813 May 31 17:48 PEAR.php
4 -rw-r--r-- 1 root root 1806 May 31 17:48 peclcmd.php
4 drwxr-xr-x 4 root root 4096 May 31 17:48 .registry/
4 drwxr-xr-x 3 root root 4096 May 31 17:48 Structures/
20 -rw-r--r-- 1 root root 19933 May 31 17:48 System.php
4 drwxr-xr-x 3 root root 4096 May 31 17:48 test/
[root@s1 php]#

Is it possible that I currently have no extensions and therefore need to create the path?
 
Yes, you are right:
Code:
mkdir -p /usr/local/lib/php/extensions/no-debug-non-zts-20060613
 
Yes, you are right:
Code:
mkdir -p /usr/local/lib/php/extensions/no-debug-non-zts-20060613

I did that and uploaded my extension to it and added the following in php.ini

extension=phpexpress-php-5.2.so

but according to phpinfo() it is still not loaded.

I'm still a bit worried about the stated path in php.ini for extensions, which is as follows:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"

What does that mean?


Also noticed the following line in the error log:

PHP Warning: PHP Startup: Unable to load dynamic library './phpexpress-php-5.2.so' - ./phpexpress-php-5.2.so: cannot open shared object file: No such file or directory in Unknown on line 0


Thanks again, pete
 
Last edited:
OK, I think I'm there!

I tried dropping my .so file in the root directory and restarted http. It worked! It was picked up by PHP in phpinfo(), so that must be what './' means as the path where extensions are loaded from.

I changed it to /usr/local/lib/php/extensions/ and moved the .so to the new location, deleted the extra directory that we made, restarted http again and it's all seems to be working :)

Thanks for all your help. I'm sure I wouldn't have managed without you :)

regards, pete
 
tnx and i have this error on my web page:

Fatal error: phpSHIELD Loader - script header is broken [10] in /home/user/domains/domain.com/public_html/classes/config.php on line 2
 
Back
Top