I've installed PHP on a Linux machine but can't seem to find the 'modules' directory from PHP. On Mac with MAMP installed, this folder is located in ~/Applications/MAMP/bin/php/php5.3.6/, but I can't figure out where this folder is installed on Linux, with yum.

Anyone who nows where yum installs these PHP-directory?


Edit: some more information about the environment

I'm working with Amazon EC2 on an Amazon Linux AMI (ami-1624987f). But while developing, I've used Ubuntu and installed everything (Apache, PHP, MySQL) via apt-get.

The installation was done by yum install php php-devel php-mysql

Now, when moving the application to EC2, seems like apt is not available on this AMI and I have to use yum. Seems like the yum installation is different from apt because I can't find the folder as described above.

Edit2: conclusion

There were more issues so at the end I've switched from Amazon Linux to Ubuntu where I also could use apt-get. But the answer from chanthemanless works. Thanks everyone!

有帮助吗?

解决方案

You can run a:

sudo php -i | grep extension

The output should show something like:

extension_dir => /blah/blah/blah

Or you could run a:

sudo find / -name '*php*'

And look at all the places you have php files.

其他提示

I was using PHP 7.2.24 in Amazon EC2 instance , even though extensions were installed and i was not able to locate the path. By doing phpinfo() I found extension_dir was set to /usr/lib64/php/modules where all directories where installed.

I modified php.ini under /etc folder and still could not reflect. But later found this very useful link Click here where i found we need to restart php-fpm after doing the modification and later restart apache.

sudo systemctl restart php-fpm.service

I hope it helps someone.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top