I have followed instructions to install and configure PhpStorm visual debugger for Mac OS, using xdebug.org/wizard.php with the tailored instructions, and worked through every step.
php -v shows:
PHP 5.6.29 (cli) (built: Dec 8 2016 23:03:30)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
in my php.ini (yes I verified this is the correct ini)
[Xdebug]
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host = 127.0.0.1
xdebug.remote_port=9000
I have restarted Apache since making the changes, and yet when I paste my phpinfo.php into the xdebug wizard it analyzes and the summary is as follows:
Xdebug Installed: no
Server API: Apache 2.0 Handler
Windows: no
Zend Server: no
PHP Version: 5.6.24
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: no
Configuration File Path: /Applications/XAMPP/xamppfiles/etc
Configuration File: /Applications/XAMPP/xamppfiles/etc/php.ini
Extensions directory: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226
EDIT: I have also followed the instructions at https://www.jetbrains.com/help/phpstorm/2016.1/configuring-xdebug.html to configure debugging on in the PhpStorm IDE.
EDIT 2:
my phpinfo():
Configuration File (php.ini) Path /Applications/XAMPP/xamppfiles/etc
Loaded Configuration File /Applications/XAMPP/xamppfiles/etc/php.ini
EDIT 3:
Link to ENTIRE PhpInfo()
https://drive.google.com/file/d/0B5Fz1a8OLiwRYW1RR0ZnbFVndjg/view?usp=sharing
Related
I am trying to enable XDebug so I can use it along with the PHPStorm (I am on Mac) and although I do not have any errors XDebug is not listed in the phpinfo() output. I also tried with XDebug wizard but with the same result. Here are all my configurations:
I modified the /usr/local/etc/php/7.2/php.ini which I get from:
$ php --ini:
Configuration File (php.ini) Path: /usr/local/etc/php/7.2
Loaded Configuration File: /usr/local/etc/php/7.2/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.2/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.2/conf.d/ext-opcache.ini
with the following:
zend_extension ="/usr/local/lib/php/pecl/20170718/xdebug.so"
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.so was installed with pecl without any errors:
$ pecl install xdebug
To confirm that I have the xdebug.so:
The output from php -m is as follows:
[PHP Modules]
ast
bcmath
...
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Xdebug
Zend OPcache
After all this configurations I run:
$ sudo apachectl restart
But in the output of phpinfo() I do not have it enabled:
I also looked all over the content, but there is nothing connected to xdebug.
Should also note that I restarted my local server before the phpinfo() output:
$ php bin/console server:start --force
My php version (Also you can see that it's showing Xdebug as properly enabled):
❯ php -v
PHP 7.2.27 (cli) (built: Jan 24 2020 03:49:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.9.3, Copyright (c) 2002-2020, by Derick Rethans
with Zend OPcache v7.2.27, Copyright (c) 1999-2018, by Zend Technologies
As #LazyOne suggested, I tried rebooting my system and everything started working properly. Looks like something was needing a reboot to start using the new settings/configurations. So if you tried everything and all looks good from configuration point, try rebooting your system.
I am usign xampp. php version 5.6.28. Thread Safe. opcache disabled.
xdebug version that comes with xampp is 2.2.5
I am running xampp in Windows 10 Enterprise 64 bit.
INI Settings are
[xdebug]
zend_extension=php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
From the command line php -v I get
C:\Users\733283>php -v PHP 5.6.28 (cli) (built: Nov 9 2016 06:40:27)
Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright
(c) 1998-2016 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
When I ran the application by enabling xdebug I get session time out error in some line of php code. When I searched I got the following. https://bugs.xdebug.org/view.php?id=1424. It is mentioned that it has been fixed in xdebug version 2.5.4 . From their download page I downloaded the xdebug version php_xdebug-2.5.5-5.6-vc11-x86_64.dll for php version 5.6.2. (They have mentioned both 2.5.4 and 2.5.5 works with php 5.6.2). I copied to the ext folder and modified the php.ini file as
zend_extension = php_xdebug-2.5.5-5.6-vc11-x86_64.dll
I tested this by running php -v from the command line. I got the following.
C:\Users\733283>php -v
Failed loading C:\xampp\php\ext\php_xdebug-2.5.5-5.6-vc11-x86_64.dll
PHP 5.6.28 (cli) (built: Nov 9 2016 06:40:27)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
When I tried their https://xdebug.org/docs/install I can see for php 5.6 the versions of xdebug 2.5 and 2.4 are mentioned. I tried both but got the same above output.
When I tried their testing page it says
Tailored Installation Instructions
Summary
Xdebug installed: no
Server API: Command Line Interface
Windows: yes - Compiler: MS VC11 - Architecture: x86
Zend Server: no
PHP Version: 5.6.28
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: yes
OPcache Loaded: no
Configuration File Path: C:\WINDOWS
Configuration File: C:\xampp\php\php.ini
Extensions directory: C:\xampp\php\ext
PHP version 5.6 is not supported.
But their install page says xdebug version 2.5 works with php v5.6
I have also raised a issue in their website. https://bugs.xdebug.org/view.php?id=1678.
How to make it work?
After installing Xdebug on Windows 10 and test that with php --version command I get this output:
C:\xampp\htdocs\instacheeta>php --version
PHP 7.2.4 (cli) (built: Mar 28 2018 04:46:46) ( ZTS MSVC15 (Visual C++ 2017) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.7.0alpha1, Copyright (c) 2002-2018, by Derick Rethans
After that I enable debug mode in PhpStorm by clicking on: , enabling Firefox XDebug addons: and then make break point on PhpStorm I expect that work correctly and stop on my break points.
But there are one problem, when I opening Validate debugger configuration dialog I can't validate debugger configuration
UPDTAE:
My web app work on 8000 port with http://127.0.0.1 IP and my web app folder is in C:\xampp\htdocs\instacheeta path
PROBLEM RESOLVE
i cahnged xdebug setting into php.ini to:
zend_extension=xdebug
[XDebug]
xdebug.remote_autostart=1
xdebug.default_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_enable =1
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
and adding PHPSTORM IDE key on PHPStorm settings from settings->PHP->Debug->DBGP
UPDATE 16.03.2017:
I checked the log and found the following error:
Xdebug requires Zend Engine API version 320151012. The Zend Engine API version 320160303 which is installed, is newer. Contact Derick Rethans at xdebug.org/docs/faq#api for a later version of Xdebug
I understand that I need to compile xdebug using another PHP header but how do I compile this with PHP7? Also, I am already using the latest xdebug version, which is 2.5.1
I installed xdebug on ElementaryOS together with XAMPP (PHP7) and PHPStorm.
When I enter "php -v" in the terminal, I get the following output
PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
In addition, "php --ini" writes:
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File: /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed: /etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
But when running "phpinfo()" in the browser (hosted by XAMPP) the output does not contain "xdebug" and the php installation seems to be another:
Configuration File (php.ini) Path /opt/lampp/etc
Loaded Configuration File /opt/lampp/etc/php.ini
In both php.ini files, I added the following but still no luck:
;[XDebug]
zend_extension="/usr/lib/php/20151012/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
I checked that xdebug.so exists at this path. It has the following authorizations:
-rw-r--r-- 1 root root 1225696 Mär 14 2016 /usr/lib/php/20151012/xdebug.so
I have no clue what to try next - maybe someone could give me a hint!
Cheers!
I want to install a debugger for PHP for my MAMP environment on Mac OS 10.8.5, where I run PHP 5.5.3. I am looking at PHPStorm and Xdebug. I am doing my best to follow the instructions on the PHPStorm site.
Here are my steps:
1) Download the Xdebug extension compatible with your PHP version
$ su admin
$ cd /Applications/MAMP/bin/php/
$ git clone git://github.com/xdebug/xdebug.git
I understand that this installs Xdebug 2.3.2 (Release date: 2015-03-22)
2) Copy the extension file to your web server in a location that is accessible by the web server. I do not understand what this extension file is, so I have been unable to complete this step.
3) Add the following lines at the end of your php.ini file:
[Xdebug]
zend_extension="/Applications/MAMP/bin/php/xdebug/php_xdebug.h"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/Applications/MAMP/tmp"
Note the additional final line, suggested by this page.
4) Restart your web server
5) Check your installation
$ php --version
PHP 5.3.28 (cli) (built: Jan 23 2014 18:02:48)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
Not the right version of PHP. Trying again:
$ /Applications/MAMP/bin/php/php5.5.3/bin/php --version
PHP 5.5.3 (cli) (built: Sep 18 2013 14:31:13)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
There is no sign of "With Xdebug..."
What exactly should I do at step 2? Have I made a mistake at any of the other steps? Are there further steps that I am missing?