OK has something fundamentally changed with ubuntu 16 and php7 regarding installing php extensions?
I just upgraded a server from ubuntu 14 to 16. The server needs to run own cloud. I also cannot rebuild it from scratch :/
apt-cache search php- | less
It lists as expected the available extentions.. eg here is a snippet:
...
php-icinga - PHP library to communicate with and use Icinga
php-igbinary - igbinary PHP serializer
php-imagick - Provides a wrapper to the ImageMagick library
php-irods-prods - PHP client API for iRODS
php-jmespath - Declaratively specify how to extract elements from a JSON document
php-json-patch - Produce and apply json-patch objects
php-json-schema - implementation of JSON schemaSo i went ahead and installed php ImageMagick:apt-get install php-imagick
The last line of the installation was WARNING: Module imagick ini file doesn't exist under /etc/php/7.0/mods-available
Sure enough under .../mods-available there is no ini file for imagik.
What is the cause of this does anyone know?
I am toying with either, php is not installed properly or the system somehow has multiple php versions installed and there is some kind of collision going on somewhere.. in usr/bin i can see php@ and php7.0*
I'm completely stuck though.
31 Answer
- The modules are .so files.
- They live @
/usr/lib/php/<buildnumber>/<modulename>.so - The ini files in
/etc/php/7.0/mods-availablesimply map to one of the above .so files ie they contain a single line of real importanceextension=<modulename> - Running
phpenmod <modulename>does nothing more than creating a reference file in the/etc/php/7.0/apache/conf.d&/etc/php/7.0/cli/conf.dfolder.
So in short.. you need to ensure the .so file exists, the ini file in mods available exists and that it is being referenced in the relevant place, eg apache, fpm or cli.
Hope this helps anyone in the same pos i was.
As mentioned in one of the comments there is a posisble bug regarding php and mysql... it is in the load order. The alphabetical ordering of the reference files in say /etc/php/7.0/apache/conf.d is actually the order the modules will be loaded by php. If you get mysqli issues, try ensuring the mysqlnd module is loaded before the mysqli module... this fixed things for me.