Where are php's extensions .so files located?
Asked Answered
C

3

26

I opened some some ini files like mysqli.ini , mysql.ini , pdo_mysql.ini. Inside those files there is an .so extension added for those files. I want to know where these .so files are stored.

Inside mysqli.ini file

; configuration for php MySQL module
; priority=20
extension=mysqli.so

Inside mysql.ini file

; configuration for php MySQL module
; priority=20
extension=mysql.so

Inside pdo_mysql.ini file

; configuration for php MySQL module
; priority=20
extension=pdo_mysql.so
Collapse answered 12/6, 2017 at 9:57 Comment(3)
locate mysql.soReductase
I'm using unix system and it says zsh: command not found: locateCollapse
Then try whereis mysql.soReductase
H
42

The .so files should be located inside your php extension directory.

You can use phpinfo() function to find the location of your php extension directory or you can use php -i from the command line.

Example

root@73fa7795de48:/# php -i | grep extension_dir
extension_dir => /usr/lib/php/20160303 => /usr/lib/php/20160303
Hideandseek answered 13/6, 2017 at 7:33 Comment(1)
this is not always correct, it highly depends on the linux distro. in my (Alpine) there is no such a folder /usr/lib/php/Starnes
R
7

On Linux system

php -i | grep extension_dir  | cut -d " " -f 5

will display you the current php extension dir

Resolutive answered 10/5, 2022 at 10:9 Comment(0)
A
0

You can also search it like so(In a Linux distro):

sudo find / -type f -name mysqli.so

From the output, it should be clear where it is located.

Ardis answered 4/8 at 11:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.