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
Related
I've recently installed PHP 8.0 on my Ubuntu 20.04 server and I'm trying to get Xdebug working with it. I've installed it as per the directions from https://xdebug.org/wizard:
Installation Wizard
Summary
Xdebug installed: no
Server API: Command Line Interface
Windows: no
Zend Server: no
PHP Version: 8.0.0
Zend API nr: 420200930
PHP API nr: 20200930
Debug Build: no
Thread Safe Build: no
OPcache Loaded: yes
Configuration File Path: /etc/php/8.0/cli
Configuration File: /etc/php/8.0/cli/php.ini
Extensions directory: /usr/lib/php/20200930
Instructions
Download xdebug-3.0.2.tgz
Install the pre-requisites for compiling PHP extensions.
On your Ubuntu system, install them with: apt-get install php-dev autoconf automake
Unpack the downloaded file with tar -xvzf xdebug-3.0.2.tgz
Run: cd xdebug-3.0.2
Run: phpize (See the FAQ if you don't have phpize).
As part of its output it should show:
Configuring for:
...
Zend Module Api No: 20200930
Zend Extension Api No: 420200930
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/lib/php/20200930
Edit /etc/php/8.0/cli/php.ini and add the line
zend_extension = /usr/lib/php/20200930/xdebug.so
Make sure that zend_extension = /usr/lib/php/20200930/xdebug.so is below the line for OPcache.
Please also update php.ini files in adjacent directories, as your system seems to be configured with a separate php.ini file for the web server and command line.
But I get this error when doing php -v:
Xdebug requires Zend Engine API version 320190902.
The Zend Engine API version 420200930 which is installed, is newer.
Contact Derick Rethans at https://xdebug.org/docs/faq#api for a later version of Xdebug.
When I ran phpize, I got this output:
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
So I'm not sure what I need to do here. Why am I unable to use the right Zend API version?
Ubuntu reports that I have the lastest versions of autoconf, automake and php-dev
I had exactly the same issue. After some investigation I realized the problem was caused because the configuration path assumed during the compiling process was pointing to the global php-config (another php version). So I just had to run the compilation with the flag (Xampp in my case):
./configure --with-php-config=/opt/lampp/bin/php-config
The next steps were the same you did and it works like a charm.
I have an Ubuntu 16.04 vagrant box running on php 7.1. When I try to build xdebug by running ./configure in xdebug-2.6.0 I get
Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.5.9-1ubuntu4.24)
PHP -v yields
Xdebug requires Zend Engine API version 320170718.
The Zend Engine API version 320160303 which is installed, is outdated.
PHP 7.1.15-1+ubuntu14.04.1+deb.sury.org+2 (cli) (built: Mar 6 2018 11:27:08) ( NTS )
So the system is running 7.1, but for some reason the configure script thinks we're still on 5.5.9
I've hit google pretty hard, but still can't find a way to update the Zend engine either.
Any ideas?
It happens because you're configuring with default settings and that is different from the PHP version you're trying to configure.
Just like you saw the PHP version using the php -v command, check the php-config version using the php-config --version command, it should be the same as php -v, but in your case, it would be different and hence this issue.
Now let's talk about how we can solve it. Since you need a different version of config, you should point that to the configure command.
For example, in your case, you need php-config7.1 (because you're using PHP v7.1, similarly for 7.2 you have php-config7.2 and so on)
To point the configure command to a specific PHP version you need to specify that as a flag called with-php-config and the value should be the location of the php-config file, a sample would be
./configure --with-php-config=/usr/bin/php-config7.1
Hope this solves the problem.
I assume you run phpize before running ./configure. Instead you need to run phpize7.1 and then ./configure
if you don't have phpize7.1 installed you can install it via:
sudo apt install apt install php7.1-dev
I am trying to install the PHP Intl extension on my new Mac (El Capitan 10.11.4) using PECL, but there is a linking error during the make stage.
Here are the steps I took:
Installed PEAR to run on Mac
Compiled and installed the ICU library (version 51.2) into /usr/local/lib
Ran this command: sudo pecl install intl and there was an error (see below). I also tried compiling the extension directly from the PHP source code ("ext" folder) and received the same error message.
I am getting the following error:
ld: file not found: libicudata.51.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [intl.la] Error 1
ERROR: 'make' failed
It looks like:
The file is missing (even though it knows the correct ICU library version to look for). Maybe it truly can't find the file. The -L switch and related switches appear to point to the correct path /usr/local/lib path.
Then, there is also some sort of architecture mismatch. So, I ran file libicudata.51.dylib and it appears to be the right architecture.
Here is what file retuned:
$ file /usr/local/lib/libicudata.51.dylib
/usr/local/lib/libicudata.51.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Has anyone run across this before? Or know how to compile PHP's Intl extension on the new Mac Book Pro (El Capitan 10.11.4)? I a hoping for some hints on where to look next, because I am a bit stumped here.
Maybe you can try just this:
brew install php56-intl
You might consider looking at these threads (https://github.com/Homebrew/homebrew-php/issues/1701) and (https://github.com/Homebrew/homebrew-php/issues/1710). I tried to reproduce your error but I failed. The most probable reason would be an icu4c that is not linked.
Try using brew link --force icu4c
I tried using php70 and
sudo pecl install intl
failed. I tried using php56, everything ran smoothly.
Try running php -v master, something like this should show up
C02QH2D7G8WM:workspace userone$ php -v master
PHP 5.6.20 (cli) (built: Apr 1 2016 08:53:48)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Try run:
brew install homebrew/php/php56-intl
I fixed this problem,here is my environment:
OS : El Capitan 10.11.4
PHP : php-7.0.5
icu : 55.1
the key point is reinstall ICU using --enable-rpath:
./configure --prefix=/opt/oss/icu --enable-release --enable-shared --enable-rpath --enable-tools
If you want to know why,please run as root
otool -L $YOUR_ICU_PREFIX/lib/libicudata.dylib
to check if the first library is absolute path.
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
I spent 2 days trying to install mongo php driver on a Mac 10.8 with MAMP (2.2), but it's almost impossible...
I've tried:
Installing Mongo Driver on MAMP
and this
Mongo PHP Driver 1.2.10 with MAMP
I have the 5.4.19 php version selected on MAMP.
I have installed the mongo driver doing:
sudo pecl install mongo
I have no errors, but once I restart MAMP I got this error on the loading process:
PHP Warning: PHP Startup: mongo: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
The output of phpize is:
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
The output of php -v is:
PHP 5.5.3 (cli) (built: Sep 18 2013 14:31:13) ...
So the version doesn't match with MAMP.
I have tried to select the same version on MAMP, but I got the same problem...
Any hints?
Thank you very much!
The phpize in your path is building extensions for PHP 5.3 (API version 20090626), but you need to match the API version of PHP in your MAMP config (which should be API version 20100412 for PHP 5.4). It looks like you have another version of php in your path, which is PHP 5.5.
To build everything with the expected version of PHP, try putting that version of PHP first in your path, eg:
export PATH=/Applications/MAMP/bin/php/php5.4.19/bin:$PATH
Then run phpize to make sure it finds the correct API version.
The API version reported by phpize -v should match that reported by php -i | grep "PHP API".
Assuming all matches, you should then be able to build following the instructions you've linked.