I just upgraded to php 5.6.4. When i do pear installs of various packages it complains that if have a module mismatch.
example:
sudo pecl install xdebug
Failed loading /usr/local/php-5.6.4/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so:
/usr/local/php-5.6.4/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so: undefined symbol: zend_execute_ex
Zend OPcache requires Zend Engine API version 220131226.
The Zend Engine API version 220100525 which is installed, is outdated.
PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with module API=20131226
PHP compiled with module API=20100525
However, 20131226 is php 5.6.4, 20100525 is 5.4 i believe. So oddly pear thinks the modules were compiled w/ 5.6 but the version of php is 5.4. Ive had this the other way around where the module is older than the php version a lot and typically just recompile those module. this one im a bit stumped.
[richv]$ php -v
PHP 5.6.4 (cli) (built: Jun 16 2015 16:08:30)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
[richv]$ pear version
PEAR Version: 1.9.5
PHP Version: 5.6.4
Zend Engine Version: 2.6.0
Running on: Linux dragon 3.10.0-229.4.2.el7.x86_64 #1 SMP Wed May 13 10:06:09 UTC 2015 x86_64
If you still have the old php version lying around, then pear/pecl probably still uses this php version - even if it shows the correct php version in pear version.
Try to change the php_bin pear config setting:
$ pear config-show
..
$ pear config-set php_bin /path/to/new/php
Related
I have recently upgraded my Mac to run PHP 8. I noticed Xdebug was no longer installed, so I tried to install it again but I get the following error:
% pecl install xdebug
/usr/local/bin/pecl: line 28: /usr/local/Cellar/php#8.0/8.0.15/bin/php: No such file or directory
/usr/local/bin/pecl: line 28: exec: /usr/local/Cellar/php#8.0/8.0.15/bin/php: cannot execute: No such file or directory
I tried the wizard at https://xdebug.org/wizard, but I can't get phpize installed.
My Mac is running Montery 12.0.1, any idea how I can fix this?
I had the same error message, I resolved it by reinstalling PHP 8.0 with homebrew as explained in this answer:
brew install php#8.0
Be careful that homebrew with also try to update all dependencies and other packages.
Then pecl worked again and I could install xdebug.
[22:39:40] coil#mac-mini.home:/Users/coil/Sites/strangebuzz.com$ php -v
PHP 8.0.19 (cli) (built: May 12 2022 09:09:32) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.19, Copyright (c) Zend Technologies
with Xdebug v3.1.4, Copyright (c) 2002-2022, by Derick Rethans
with Zend OPcache v8.0.19, Copyright (c), by Zend Technologies
I can't debug PHP script in Visual Studio Code - Linux (Ubuntu 18.04.2 LTS).
Before Update, the Xdebug version I was fettching error such as :
Xdebug requires Zend Engine API version 320170718.
The Zend Engine API version 320160303 which is installed, is outdated.
After an update the Xdebug version now fetching following error:
Error: Failed loading /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so: /opt/lampp/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so: undefined symbol: zend_empty_string.
This is my PHP status:
php -v
PHP 7.2.17-0ubuntu0.18.04.1 (cli) (built: Apr 18 2019 14:12:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.17-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans
Please correct me if anything is missing at my end.
I would suggest to use the tailored wizard from the Xdebug website:
Xdebug Wizard
It seems that you are mixing the PHP versions: The Zend Engine API version 20160303 corresponds to PHP 7.1. For 7.2 you will need API version 20170718.
I suppose you have several versions of PHP active - most probably 7.1, 7.2 and 7.3. In such case you need to run the proper phpize - phpize7.2 when going through the wizard.
After one of PHP updates (ubuntu) I got an error Class 'AMQPConnection' not found in my application.
I reinstalled latest stable version (1.7.1) of amqp via pecl
sudo pecl uninstall amqp
sudo pecl install amqp
It asks me:
downloading amqp-1.7.1.tgz ...
Starting to download amqp-1.7.1.tgz (79,905 bytes)
..................done: 79,905 bytes
18 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Set the path to librabbitmq install prefix [autodetect] :
When I choose one of the variants - builds fails, error always like
configure: error: Please reinstall the librabbitmq distribution itself or (re)install librabbitmq development package if it available in your system
ERROR: `/tmp/pear/temp/amqp/configure --with-librabbitmq-dir=20121113' failed
If I choose autodetect, installation proccessed successfully.
Then I add extension=amqp.so into php.ini and get an error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/amqp.so' - /usr/lib/php5/20131226/amqp.so: cannot open shared object file: No such file or directory in Unknown on line 0
I found amqp.so via
locate amqp.so
It display
/usr/lib/php5/20121212/amqp.so
Then I change extension=amqp.so to the full path /usr/lib/php5/20121212/amqp.so
And I get very interesting error
PHP Warning: PHP Startup: amqp: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
As I understand, PHP compiled with version newest than Amqp.
But it is the latest amqp library version.
Pecl shows:
Package Stable/(Latest) Local
amqp 1.7.1 (stable) 1.7.1 Communicate with any AMQP compliant server
PHP version is 5.6.4
PHP 5.6.4-4ubuntu6 (cli) (built: Apr 17 2015 15:47:51)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend
Technologies
with Xdebug v2.2.6, Copyright (c) 2002-2014, by Derick Rethans
Here's my environment configuration (Ubuntu).
I have installed PHP 5.5.9 version via apt-get, and using PHPBrew also installed version 7.0.6. The PHP7 version is turned on.
$ which php
/home/username/.phpbrew/php/php-7.0.6/bin/php
$ php -v
PHP 7.0.6 (cli) (built: May 12 2016 08:54:46) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
I have composer installed globally by putting it in proper directory:
$ which composer
/usr/local/bin/composer
Now, when I run composer require <something>, it uses PHP 5.5.9 and returns error like (when the package being installed requires it of course):
Problem 1
- This package requires php >=5.6.0 but your PHP version (5.5.9) does not satisfy that requirement.
Why doesn't composer use PHP version proper for current CLI configuration?
Please note that my question is why it happens and not how to solve the problem, because I've found already a few workarounds for that. I want to understand what happens here.
I used Homebrew to install PHP versions 5.4 and 5.5 on my system. However, it seems that even after installing and linking to php55 my computer is still trying to run the version initially used by the system.
php --version
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/php_openssl.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/php_openssl.dll, 9): image not found in Unknown on line 0
PHP 5.3.26 (cli) (built: Jul 7 2013 19:05:08)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
I believe Homebrew sets up PHP under '/usr/local/lib' and not '/usr/lib/'.
What do I need to do to correctly have my system use the Homebrew version of PHP?
You have to put /usr/local/bin at the front of your $PATH. In your ~/.bashrc file, add something like
export PATH="$(brew --prefix)/bin:${PATH}"