ini files missing when installing php extensions ubuntu 16 php 7

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

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 schema

So 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.

profilepic.png
manpreet 2 years ago
  1. The modules are .so files.
  2. They live @ /usr/lib/php//.so
  3. The ini files in /etc/php/7.0/mods-available simply map to one of the above .so files ie they contain a single line of real importance extension=
  4. Running phpenmod  does nothing more than creating a reference file in the /etc/php/7.0/apache/conf.d & /etc/php/7.0/cli/conf.d folder.

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.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community