PHP Xdebug not in php - 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

Related

Unable to install Xdebug after upgrading 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

Install xdebug on specific php version

I'm trying to install xdebug.
I've already seen some issues about it (like this one : Installing xdebug with PHP 5.5 ) but it seems outdated and not corresponding to my issue).
When I try
sudo pecl install xdebug
I'm getting the following error
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading xdebug-2.8.0.tgz ...
Starting to download xdebug-2.8.0.tgz (238,122 bytes)
.................................................done: 238,122 bytes
69 source files, building
running: phpize
sh: 1: phpize: not found
ERROR: `phpize' failed
It seems that means phpize isn't installed in my php version
php -v
PHP 7.2.24-0ubuntu0.19.04.1 (cli) (built: Oct 24 2019 11:49:39) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.19.04.1, Copyright (c) 1999-2018, by Zend Technologies
So, some topics seems to tell me to change my php version to download a version with phpsize included. But I was more looking for a way to add phpsize to my current php version but I don't know how to do that.
Thanks for your assistance
If Ubuntu first you need install php dev version:
sudo apt install php7.x-dev
And then:
sudo pecl install xdebug
I had some problems with xdebug version too.
I had to install an specific version for php7.1 using PECL,
I don't really know if your question is already solved but let me share you this webpage, it's the compatibility graph to know wich version works with an specific php versions:
https://xdebug.org/docs/compat
As far as I know if you want to install the latest xdebug version you can use the repo, but if you need an old version you'll be forced to install it using PECL.
Hope you find this answer usefull!

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.

Error while installing Xdebug in PHP version 5.6.32

I am new to PHP. I want to enable Xdebug in Eclipse IDE but when I check Xdebug for my version https://xdebug.org/wizard.php showing error:- here is what
Tailored Installation Instructions
Summary
Xdebug installed: no
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC11 - Architecture: x86
Zend Server: no
PHP Version: 5.6.32
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\Windows
Configuration File: E:\xampp1\php\php.ini
Extensions directory: E:\xampp1\php\ext
PHP versions below 7.0 are not supported.
If you like Xdebug, and thinks it saves you time and money, please have a look at the donation page.
Please help to install Xdebug in Eclipse. I've installed XAMPP, Eclipse PDT PHP.
It seams your PHP Version is too low for xdebug:
Your PHP: "PHP Version: 5.6.32"
xDebug log said: "PHP versions below 7.0 are not supported."
So, after you upgrade you PHP version and successfully install xdebug, you should see (example):
# php -v
HP 7.2.3 (cli) (built: Mar 8 2018 10:30:06) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
with Zend OPcache v7.2.3, Copyright (c) 1999-2018, by Zend Technologies
I wanted to update this question because it is still possible to install XDebug against 5.6 and may still be necessary for legacy applications.
The wizard won't help you if you need to install XDebug for an older version of PHP (<7); you'll have to read the documents and work out the process yourself.
At https://derickrethans.nl/xdebug-php5.html the author states that the older source is available for downloading and using with older versions of php, and that 2.5 is the last version to work with PHP 5.6. You can download xdebug 2.5 from https://xdebug.org/download.php (or other versions as required).
The instructions on how to do this are on the XDebug website but maybe a little hard to grasp. A rough guide for installing installing on a CentOS 7.5 with Php 5.6 would be:
wgets https://xdebug.org/files/xdebug-2.5.5.tgz
tar -xvzf xdebug-2.6.0.tgz
cd xdebug-2.6.0
phpize [troubleshoot: yum install php-devel]
./configure --enable-xdebug
make
create a directory keep the xdebug module: mkdir /usr/php/xdebug/255
cp modules/xdebug.so /usr/php/xdebug/255
Find the active php.ini using php -i or phpinfo() in a script.
Restart the webserver: sudo service httpd restart
Make sure XDdebug is reported as enabled.
Edit php.ini: sudo nano /etc/php.ini
Add (or whatever your preferred options are) to php.ini:
zend_extension="/usr/php/xdebug/255/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_autostart = 1
xdebug.remote_port="9000"
xdebug.remote_connect_back=on
Configure your client to connect. I've had this working with vscode.
You can find more information at https://xdebug.org/docs/install.

Installing xdebug with PHP 5.5

I've read quite a lot answers but couldn't figure out why xdebug doesn't work.
php.ini:
[xdebug]
zend_extension="/usr/lib/php5/20090626/xdebug.so"
php -v:
PHP 5.5.6-1+debphp.org~precise+2 (cli) (built: Nov 21 2013 14:31:41)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
/usr/lib/php5/20090626/xdebug.so does exist. No zend optimizer in php.ini.
Also if I try to install xdebug:
pecl/xdebug is already installed and is the same as the released version 2.2.3
install failed
Thanks in advance.
Ok so I've stumbled upon this myself.
First of all, the 20090626 lib is compiled for php 5.3. So you can't really use that. Here are the steps I've performed in order to be able to use xdebug with php 5.5:
Download the source via xdebug download page.
Follow this guide for compiling your source into lib.
So now the extension is in correct source folder: 20121212, and you need to enable xdebug in your config.
I'm on ubuntu 12.04, so next steps might not work with your system:
create 20-xdebug.ini config and copy it to both /etc/php5/apache/conf.d and /etc/php5/cli/conf.d folders (if you plan on using xdebug in your cli of course). Insert next line of code there: zend_extension=xdebug.so
enable xdebug in both apache2 and cli php.ini configuration files:
xdebug.remote_enable = 1
xdebug.renite_enable = 1
xdebug.max_nesting_level = 1000
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = '/var/log'
See more about xdebug settings: http://xdebug.org/docs/all_settings
php -v:
PHP 5.5.7-1+sury.org~precise+1 (cli) (built: Dec 12 2013 21:37:40)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
Since this seems to bother more and more people trying to install xdebug via pecl here are the options:
Windows: Get the binary
Ubuntu (>12.04): sudo apt-get install php5-xdebug
Linux (other): via package manager or compile the latest source
Using PECL to install X-Debug for PHP5.5 as #Slayer Birden also answered will not work up to now and I don't think it will change in the near future.
I had a similar problem on Ubuntu 14.10. I forgot to enable xdebug:
sudo php5enmod xdebug
after installing xdebug from repository:
sudo apt-get install php5-xdebug
Also do not forget to restart web server
sudo service apache2 restart
My xdebug.ini looks like this:
zend_extension=xdebug.so
xdebug.remote_enable = 1
for xampp server first download xdebug and insert into php extention and edit php.ini file like this:
[XDebug]
; Only Zend OR (!) XDebug
; XAMPP and XAMPP Lite 1.7.0 and later come with a bundled xdebug at C:\xampp/php/ext/php_xdebug-2.3.1-5.5-vc11.dll, without a version number.
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
; Port number must match debugger port number in NetBeans IDE Tools > Options > PHP
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"
[PHP_XDEBUG-2.3.1-5.5-VC11]
zend_extension="C:\xampp\php\ext\php_xdebug-2.3.1-5.5-vc11.dll"
I ran into this problem today. Found out that the latest version on download page might actually not work. Download the one under Xdebug 2.3.0, select "PHP 5.5 VC11 TS (32 bit) (MD5: ef4a8994cef26c47ac891d6872e391b3)". It worked for me. I tried ver 2.3.3 and 2.3.2 before which did not work.
To install a very specific version of Xdebug for a specific version of PHP you can do it by compilation from sources. E.g. if you would like to compile xdebug-2.5.5 for PHP 5.6 run following commands in console (Ubuntu):
sudo apt install php5.6-dev
cd ~/Downloads
wget "https://xdebug.org/files/xdebug-2.5.5.tgz" -O "xdebug-2.5.5.tgz"
tar -xzf xdebug-2.5.5.tgz
cd xdebug-2.5.5/
/usr/bin/phpize5.6
./configure --enable-xdebug --with-php-config=/usr/bin/php-config5.6
make
sudo make install
All available versions of Xdebug can be found here. Xdebug compilation guide is here.

Categories