Unable to install Xdebug after upgrading PHP - php

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

Related

Uninstall Xdebug 3 and install v2.9.8

I've installed Xdebug in my system. Then in PhpStorm I've done all the configuration to debug the code using Xdebug.
But in Xdebug is not working properly with PhpStorm. So I would like to remove Xdebug from my local machine. But it's unable to uninstall it.
Using the following command I understood it was installed in my local machine:
php -v shows:
PHP 7.3.28-2+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jun 4 2021 21:23:19) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.28, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.28-2+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
But while ran the uninstall command I am getting the following response in terminal:
sudo apt-get remove php-xdebug
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'php-xdebug' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
Previously I was using Xdebug v2.9.8, it was working fine and I was able to debug the code. So I would like to install the same version.
So looking forward for your support to uninstall version 3 and proper command to install version 2.9.8 in my PHP 7.3 version.

Mojave 10.14.5 and homebrew PHP not working properly

I'm trying to install PHP 7.(2|3) with Homebrew on Mojave 10.14.5 and I can't get it to work.
Fresh install of Mojave with only :
Google Chrome
Iterm
Zsh
Oh My Zsh
Right after Mojave is installed I run the following in my terminal :
Install Homebrew (command line from the official website)
brew install composer
brew install php
composer global require laravel/installer (composer is in the path)
laravel new blog
It ends up with a segmentation fault :
[1] 9310 segmentation fault laravel new blog
I tried to reboot, uninstall and reinstall PHP/Homebrew/Mojave several times. I always ends up with the same error.
Also tried with php#7.2 and php#7.1 and other packages like wp-cli, it's the same.
I'm desperate, please help.
EDIT WITH MORE INFO :
composer --version:
Composer version 1.8.6 2019-06-11 15:03:05
php -v:
PHP 7.1.26 (cli) (built: Apr 23 2019 10:38:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.26, Copyright (c) 1999-2018, by Zend Technologies
php -i:
here

Laravel 5.4 with MongoDB MAC Mojave

Hello I having trouble to to install "jenssegers/mongodb": "^3.2" on my local environment.
i have this error:
I have added to my /etc/php.ini full path to extentions="/usr/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so"
restart the php and apache
I have try to find mongodb.ini, fail on that.
I try all the tutorial is google... still no luck
Can any one help me please?
PHP 7.1.23 (cli) (built: Feb 22 2019 22:08:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
It seems that you forgot to install MongoDB PHP Driver itself.
To do that just install it with pecl:
sudo pecl install mongodb-1.5.3
1.5.3 is the last stable version, so I'd recommend to use it rather than the most recent 1.6.0alpha.
Then, don't forget to add it to your php.ini (run php --ini to see where it's located):
extension=mongodb.so
To test that it works just run:
php -m | grep mongo
If you see mongodb in output, then it works.

PHP Xdebug not in php

hi i install homebrew install some brew things and now i need install Xdebug but when i write to terminal on mac php --version there is only version of php not version php with xdebug only version of php
$ php --version
PHP 7.2.8 (cli) (built: Aug 28 2018 16:32:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
help me i doo all things what i should but it not work correctly help thx
With the migration to Homebrew-core the php formula has stopped taking over the role of PECL. Installing xdebug can (and should) be done through PECL (https://pecl.php.net/package/xdebug).
pecl update-channels
pecl list-all
pecl install xdebug
or upgrade it
pecl upgrade xdebug
After that you'd need to update your php.ini with a line to specify xdebug's location, as suggested on xdebug.org:
zend_extension="/usr/local/php/modules/xdebug.so"
Additionally, you may need to put in there some settings for xdebug, for example:
xdebug.collect_vars=1
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_port=9005
Source: http://www.artemdwo.com/install-php72-and-xdebug-on-mac-os-x

Configuring Xdebug debugger on PhpStorm w/ Laravel, Vagrant

Trying to configure my Vagrant server to use Xdebug. Read that it comes with Xdebug, but I checked this and doesn't seem to be true.
SSH into Vagrant machine,
$ php -v
reveals that machine is using
PHP 7.2.0-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Nov 30 2017 13:58:33) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.0-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies with blackfire v1.18.0~linux-x64-non_zts72, https://blackfire.io, by SensioLabs
No xdebug. So I tried installing xdebug with
$ brew install homebrew/php/php72-xdebug
Seemed to work. But then I tried finding the path to xdebug.so:
$ locate xdebug.so
/usr/lib/php/20131226/xdebug.so
/usr/lib/php/20151012/xdebug.so
/usr/lib/php/20160303/xdebug.so
Tried putting all of these into php.ini, and they all failed.
Tried installing via
$ sudo apt-get install php7.2-xdebug
E: Unable to locate package php7.2-xdebug
So, I searched, and found:
$ apt search xdebug
Sorting... Done
Full Text Search... Done
php-xdebug/xenial,now 2.5.5-3+ubuntu16.04.1+deb.sury.org+1 amd64 [installed] Xdebug Module for PHP
What am I doing wrong to get Xdebug and php configured on my remote machine?
I was testing with Postman using the mapped domain.. Using the actual server IP works.
So, instead of "restfulapi.dev", hit "128.153.123.21" or whatever it is.
Very silly.

Categories