I'm trying to build a bash script to install the Source Guardian PHP extension however the destination directory is different on every subsequent release of Ubuntu.
Installing PHP5 on Ubuntu 14.04 results in the extensions being stored in /usr/lib/php5/20121212+lfs/, in Ubuntu 15.04 this directory changes, e.g. /usr/lib/20131226/
I've checked /etc/php5/fpm/php.ini and /etc/php5/fpm/php-fpm.conf but neither of these files has any mention of 20121212+lfs or 20131226.
If I place the Source Guardian extension anywhere else, it does not load.
Is there a way to programmatically determine the extension folder?
Best Answer
Maybe you should do this:
If
php-config
doesn't exist, thenapt-get install php-config
if Ubuntu/Debian oryum install php-config
if CentOS/Red Hat)That command will give exact location of your
php
extension folder.Don't forget to change your
php.ini
in order to use extensions.