Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP extensions not loading in phpinfo

So I'm running MAMP on Mountain Lion and I've installed gmagick and imagick using pecl, both are relase candidates (mainly because gmagick doesn't have a stable release and imagick 3.0.0 doesn't install, it gives a make error). The modules appear when I run php -i in the terminal but not in phpinfo(), I have checked the php.ini it is the same for both so that is not the issue.However I have installed bitset(which is a stable release) and it appears in phpinfo() and php -i. So my question is does PHP have any configuration option that does not load extensions if they are not stable? Btw, I did restart my server after the changes to the ini file.

like image 591
Vidi Avatar asked Mar 07 '13 13:03

Vidi


People also ask

How do I access Phpinfo PHP?

Checking PHP Information Using Hosting Control Panel Once you're logged in, scroll down and go to Advanced -> PHP Info. You'll then be forwarded to a page with detailed information about your current PHP version, modules, and values, etc.

What is the use of Phpinfo () in PHP?

Because every system is setup differently, phpinfo() is commonly used to check configuration settings and for available predefined variables on a given system. phpinfo() is also a valuable debugging tool as it contains all EGPCS (Environment, GET, POST, Cookie, Server) data.


3 Answers

You will probably now have two php installations on your machine. Mountain Lion ships with a preinstalled php version. Trylocate php.ini in Terminal to find out how many php.inis are installed.

In your phpinfo() page there is also noted which php.ini is in use. You might want to open the exact php.ini which is used for your phpinfo() and make sure the extentions are loaded. There should be two lines like extension=/path/to/gemagicext/gmagic.so extension=/path/to/imagick/imagick.so

like image 152
Martin Fahl Avatar answered Oct 01 '22 16:10

Martin Fahl


I faced a similar problem with php-fpm and nginx server. The problem was due to the fact that the updated php configuration was not reflected in the current active php-fpm worker processes. I have to manually kill the fpm process and restart it again to have the updated extensions info.

Steps that worked for me:

1) Look for active php-fpm process

 ps ax | grep "fpm"

mostly this will list more than one process

2) kill process manually

kill -9 [pid_got_from_previous_command]

3) restart php-fpm process

sudo service php5-fpm start

Note: Trying something like sudo service php-fpm reload or sudo service php-fpm restart didn't work since the old child processes retained the old configuration. Killing the active processes and restarting php fpm what updated the phpinfo for me.

like image 20
palerdot Avatar answered Oct 01 '22 17:10

palerdot


I had the same problem CentOS 6.6 x64, php 5.5.27 and I followed the steps from http://php.net/manual/en/imagick.installation.php

First of all download a tar image of the ImageMagick install from here: sourceforge.net/projects/imagemagick/files/

Unpack it and then from terminal issue the following commands:

1.  "cd ImageMagick-6.9.1-10" - go where you placed the folder
2.  ./configure
3.  make
4.  make install
5. make check
6. install imagick extension from pecl.php.net/package/imagick/download 3.1.2
7. cd imagick-3.1.2
8. phpize
9. ./configure --with-imagick=/opt/local
10. make
11. make install
12. Copy imagick.so in your PHP extensions folder and add extension=imagick.so in php.ini

Restart apache: service httpd restart

like image 20
ursuleacv Avatar answered Oct 01 '22 17:10

ursuleacv