menu

Questions & Answers

How to install module libphp5.so in Apache serve CentOS 7

I have installed php 5.6.27 in Cent OS 7. Also I uncommented configurtion line in:

LoadModule php5_module       modules/libphp5.so

But I does not have this file in directory modules/.

How can I install this?

Comments:
2023-01-25 00:10:04
did you compile PHP from source or 'yum install'-ed?
2023-01-25 00:10:04
InstalledUsing Yum
2023-01-25 00:10:04
try to 'locate libphp5.so' and install mlocate beforehand, if needed
2023-01-25 00:10:04
How can I do this? Where to get libphp5.so'?
2023-01-25 00:10:04
just say yum -y install mlocate then updatedb then locate libphp5.so in your command line. let's see whether it is in some other location
2023-01-25 00:10:05
Where to execute command locate libphp5.so? In directory with modules?
2023-01-25 00:10:05
locate libphp5.so it returns me nothing
2023-01-25 00:10:05
2023-01-25 00:10:05
R u resolved the problem?. Now iam having the same problem.help me to resolve it....\
2023-01-25 00:10:05
Dev did not make it extremely clear, but with the standard CentOS repo, you can yum install php and this will give you the file. To find out what packages have this file you can use the command: yum whatprovides *libphp.so
2023-01-25 00:10:05
yum whatprovides *libphp5.so was the command I used to find the correct php package to install.
Answers(1) :

The exact source and name of the PHP version installed is important. I too had this problem and had installed php56.x86_64 from remi-safe repo. However it wasn't until I installed php.x86_64 from remi-php56 repo that things worked (and libphp5.so showed up).

I recommend revisiting the version installed and repo source (yum list installed), and then look for an alternative of one or the other, or both (version/repo source).

Comments:
2023-01-25 00:10:05
php provides mod_php for base (default) version, php56-php provides mod_php for SCL version (parallel installation).
2023-01-25 00:10:05
I think the remi libphp5.so file is supposed to be here: /opt/remi/php56/root/usr/lib64/httpd/modules/libphp5.so. However, this folder is missing: /opt/remi/php56/root/usr/lib64/httpd. What package should it be in? I installed php56.x86_64 and php56-php-cli.x86_64 and some others.
2023-01-25 00:10:05
@raphael75 This answer is for the "single version" scenario. If you're using Remi's "multiple versions" scenario, you can use the "php56-" prefix, i.e. yum install php56-mod_php. The resulting library is located at /opt/remi/php56/root/usr/lib64/httpd/modules/libphp5.so.