two php extensions directories - bug?

lastguru

Member
Jul 29, 2010
13
0
51
cPanel Access Level
Root Administrator
Hi,

I have recently discovered that there are two php extensions directories - one that is actually used (/usr/local/lib/php/extensions/no-debug-non-zts-20090626) and the one that has all the custom extensions actually installed (/usr/lib/php/extensions/no-debug-non-zts-20090626). After spending some time trying to install memcache extension, i found that it is installed in a wrong directory, so I linked the later to the former. No idea if it will not break anything else, but at least it is working for now...

It seems that many people on this forum know about this issue, but I still have not found any cPanel official reply to that. In my opinion, it is a bug, as it doesn't allow to install any php extensions normal way (i.e., through cPanel interface) and leads to unintelligible problems with php extensions. If both directories are needed to be separate, then please, cPanel, provide a fix for extension installer to use the correct one!
 

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
6
68
PK
cPanel Access Level
DataCenter Provider
Do you have two PHP versions on the server. What is the output of these commands run on SSH.

Code:
php -i |grep extension_dir
rpm -qa |grep -i php
php -v
whereis php
Hi,

I have recently discovered that there are two php extensions directories - one that is actually used (/usr/local/lib/php/extensions/no-debug-non-zts-20090626) and the one that has all the custom extensions actually installed (/usr/lib/php/extensions/no-debug-non-zts-20090626). After spending some time trying to install memcache extension, i found that it is installed in a wrong directory, so I linked the later to the former. No idea if it will not break anything else, but at least it is working for now...

It seems that many people on this forum know about this issue, but I still have not found any cPanel official reply to that. In my opinion, it is a bug, as it doesn't allow to install any php extensions normal way (i.e., through cPanel interface) and leads to unintelligible problems with php extensions. If both directories are needed to be separate, then please, cPanel, provide a fix for extension installer to use the correct one!
 

lastguru

Member
Jul 29, 2010
13
0
51
cPanel Access Level
Root Administrator
Upon executing this command, i see the following:

Code:
# php -i |grep extension_dir
extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20090626 => /usr/local/lib/php/extensions/no-debug-non-zts-20090626
sqlite3.extension_dir => no value => no value
And no, I don't have and don't need two PHP versions. I just have 5.3.6.
 

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
6
68
PK
cPanel Access Level
DataCenter Provider
/usr/local/lib/php/extensions/no-debug-non-zts-20090626 is then the default extensions directory for your php install. Other might be a rogue directory. You could rename/move it and see if everything works. You could run the other rpm command to see if someone installed some php rpms that could have messed up the install.

Upon executing this command, i see the following:

Code:
# php -i |grep extension_dir
extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20090626 => /usr/local/lib/php/extensions/no-debug-non-zts-20090626
sqlite3.extension_dir => no value => no value
And no, I don't have and don't need two PHP versions. I just have 5.3.6.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you do not find PHP rpm versions and believe this to be a bug, please report it and provide login access to the machine in the bug report. We have a link at the top of the forum for reporting bugs, since that is the official channel to report believed bugs to our staff and developers. The direct url is also http://go.cpanel.net/bugs
 

ckh

Well-Known Member
Dec 6, 2003
358
1
168
Phoenix, AZ
cPanel Access Level
DataCenter Provider
I have it that way on all my servers, just recently received a server with a fresh cPanel install, and both directories are there. Not sure the reason for it though.

I installed both pecl imagick and apc and it uses the usr/lib/php/extensions directory and if you don't symlink it or copy the .so files to the /usr/local/lib/php/extensions/... directory, you'll receive php errors.
 

britsenigma

Well-Known Member
Dec 14, 2008
85
0
56
Well, I've got no problems currently, fixed it myself, I did have, for some reason, php wasn't finding the modules in either of those directories, which is why I posted earlier.

However, it's working now, and I cleared the directories before using Easy Apache again. But as you can see, it installs those files to two locations, but the later looks like they were all copied after the install, as the modified times are identical. Also noticed easy apache leaves 5.2 files in place if you swap to 5.3 php.

As for submitting bugs, I Don't have time to wait for an answer, I google to find solutions to my problems. Why have a bug tracking system no one can see, not saying you can't have an internal one. But, at least with a forum, other people who run into the same problem, are likely to end up on this page. Which reduces your ticket burden, just my 2 cents.Clipboard02.jpg