trying to install imagick extension for php (here is the env):
[root#localhost src]# cat /etc/*release*
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)
cpe:/o:centos:linux:6:GA
[root#localhost src]# php -v
PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
---------------
[root#localhost src]# pecl install imagick
downloading imagick-3.3.0.tgz ...
Starting to download imagick-3.3.0.tgz (179,978 bytes)
.................done: 179,978 bytes
17 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-armandPkqjM8/imagick-3.3.0
running: /var/tmp/imagick/configure --with-imagick
.....
-- I'm getting this error in the end... Anyone can help? Thanks in advance!
/var/tmp/imagick/imagick.c:3299: error: ‘ZEND_MOD_END’ undeclared here (not in a function)
make: *** [imagick.lo] Error 1
ERROR: `make' failed
I faced the same problem. The possible solution is to install it from source following the steps:
cd /usr/local
wget http://pecl.php.net/get/imagick-3.3.0.tgz
tar zxvf ./imagick-3.3.0.tgz
cd imagick-3.3.0
phpize
./configure
make
make test
Then, you'll get the same error. To fix this, edit the file where the variable is undeclared:
vim /usr/local/imagick-3.3.0/imagick.c
to something like this:
3298 #endif
3299 // ZEND_MOD_END
3300 {NULL, NULL, NULL}
3301 };
3302 #endif
and try running again:
make test
make install
Hope this helps.
Since a (patched) php-5.3.3 is what comes with RHEL/CentOS 6 upgrading php is not always feasible. To build the imagick pecl module for CentOS 6 use version 3.1.2.
$ pecl install imagick-3.1.2
Related
I'm trying to install mongodb exentsion for php 8.0.13 on my MacOS Monterey.
I try sudo pecl install mongodb command: and then get below errror.
/opt/homebrew/Cellar/php#8.0/8.0.13/include/php/ext/spl/spl_iterators.h:151:4: error: unknown type name 'pcre_cache_entry'
pcre_cache_entry *pce;
^
1 error generated.
make: *** [php_phongo.lo] Error 1
ERROR: `make' failed
which php: /opt/homebrew/bin/php
php -v: PHP 8.0.13 (cli) (built: Nov 28 2021 13:11:14) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.13, Copyright (c) Zend Technologies with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies
Can anyone help me for fix this error?
Thanks for your attention!
To compile MongoDB using PECL you will have to copy the pcre2.h to php's include directory.
For php#8.0, you can do this, But you will have to do this after every PHP release or if you switch the PHP version.
pcre2_h="$(find "$(brew --cellar pcre2)" -name "pcre2.h")"
cp -f "$pcre2_h" "$(brew --cellar php#8.0)"/*/include/php/ext/pcre
To avoid this I would recommend using shivammathur/extensions brew tap for installing PHP extensions.
I need to configure xdebug directory on centos 6.
When I run ./configure in xdebug to prepare my make file I get:
configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.4.0 (found 5.6.30)
however
php -v
gives me:
PHP 7.1.30 (cli) (built: Jul 23 2019 18:46:30) ( NTS )
wtf
However, after poking around a bit I see that centos comes with a package called php-devel that defaults to 5.6. Could this be the issue? If so how do I resolve it? yum search gave me this package: ea-php71-php-devel.x86_64 but it is already installed I guess...
output of which php:
/usr/local/bin/php
and which phpize
/usr/local/bin/phpize
phpize give the output:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
which should be:
Zend Module Api No: 20160303
Zend Extension Api No: 20160303
And I notice that running
php-config --version
gives me: 5.6.30
Thats probably the issue but how do I fix it? I looked at xdebug faqs and saw: "If it doesn't match up, and perhaps the wrong "phpize" binary is found on the path, you can run configure as follows":
/full/path/to/php/bin/phpize
./configure --with-php-config=/full/path/to/php/bin/php-config
But I dont understand that.... /full/path/to/php/bin/phpize is the path to the binary isn't it - how can you configure that then?
Path to cpanel php-devel bin
/opt/cpanel/ea-php__VERSION__/root/usr/bin/
For package ea-php71-php-devel.x86_64 7.1.30-4.4.1.cpanel
cd /full/path/to/module/xdebug
/opt/cpanel/ea-php71/root/usr/bin/phpize && ./configure --with-php-config=/opt/cpanel/ea-php71/root/usr/bin/php-config
I just updated my mac from Sierra to High Sierra. I installed PECL following those instructions and I'd like to install xdebug running pecl install xdebug.
Output
79 source files, building running: phpize grep:
/usr/include/php/main/php.h: No such file or directory grep
/usr/include/php/Zend/zend_modules.h: No such file or directory grep:
/usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for: PHP Api Version: Zend Module Api No: Zend Extension
Api No: building in
/private/tmp/pear/install/pear-build-rootPkeU2l/xdebug-2.6.0 running:
/private/tmp/pear/install/xdebug/configure
--with-php-config=/usr/bin/php-config /private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h'
file not found
include "php.h"
1 error generated. make: *** [xdebug.lo] Error 1 ERROR: `make' failed
Question
I feel I might did something wrong during the installation of PECL ...
What should I do ?
FIY
php -v
PHP 7.1.16 (cli) (built: Mar 31 2018 02:59:59) ( NTS ) Copyright (c)
1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018
Zend Technologies
Need to run this
xcode-select --install
I'm new to server and linux and I ran into some problems. I'm trying to update my PHP by looking for linux commands through the net. Some commands ran perfectly but some not.
I tried using this command to install php-gd since I have this error message 'Required GD library is missing'. So, I tried to run this below:
yum install php-gd
However, it give me this error message below:
php56w-common conflicts with php-common-5.3.3-46.el6_6.x86_64
Here are some info on my server:
[root#uat ~]# rpm -ql php
package php is not installed
[root#uat ~]# rpm -qa php\*
php56w-pdo-5.6.11-1.w6.x86_64
php56w-5.6.11-1.w6.x86_64
php56w-cli-5.6.11-1.w6.x86_64
php56w-common-5.6.11-1.w6.x86_64
php56w-mysql-5.6.11-1.w6.x86_64
[root#uat ~]# rpm -Va php\*
S.5....T. c /etc/php.ini
[root#uat ~]# which php
/usr/bin/php
[root#uat ~]# php -v
PHP 5.6.11 (cli) (built: Jul 10 2015 22:43:20)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
Do you know what have I done wrong upgrading my php? Should I remove all php files on my server and reinstall? How?
Solved it by removing all php using "yum remove php php-common"
and modified the filename "remi.repo" under the folder /etc/yum.repos.d like below:
[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
making sure that php56 is enabled=1.
You should run:
yum install php56w-gd
So when install php-extension have error:
*-common conflicts with php-common-5.3.3-46.el6_6.x86_64
Just type *-extension
Example:
yum install php-fpm have error
Error: php56u-common conflicts with php-common-5.3.3-46.el6_7.1.x86_64
then you should run
yum install php56u-fpm
The reason of this error is you install a php version don't match the system repo version. So yum get a version of the system repo, but this don't compatible with the php version you have installed. When you specific the php version, yum get the right version, so happy!
Go to /etc/yum.repos.d.
Remove the extra repository that you can see in your complete error message.
Nima
If you are using Centos 6.7 and have php 5.6 installed, the following command worked for me:
sudo yum install php56w-pecl-xdebug.x86_64 (I was installing xdebug, not GD)
I found this by running yum search php56
So we have this machine with Linux running as development server.
However we are having som issue's getting the imagick extension installed.
We are using:
PHP 5.5.3 (cli) (built: Aug 21 2013 18:12:49)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
And
Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
If we try to install imagick with this command we get the following:
# pecl install imagick
downloading imagick-3.1.2.tgz ...
Starting to download imagick-3.1.2.tgz (94,657 bytes)
.....................done: 94,657 bytes
15 source files, building
running: phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
ERROR: `phpize' failed
How can we do the install correct without changing our PHP version to a dev version.
Is there a version of imagick for PHP 5.5.3 or a version of imagick we can use with our PHP version.
Help would really be appreciated!
as root, execute the following command
yum install php-devel
Then try installing the imageMagick extension again
We managed to installed the extension by removing the old php installed package because it was from a different repository. After that we installed everythings from the same repository. After that we needed to added some non default extensions back in php.ini to let everything work again! Don't know the exact details,I'm no unix expert ;).