Can someone help me with a next step? Which software should I use and how do I go about? What is RedHat?
I have XAMPP installed. I have searched some solutions but my case is a bit different.
Below is the output from Installation Wizard (https://xdebug.org/wizard).
I do not know how to proceed from point "2.Install the pre-requisites for compiling PHP extensions." and onwards.
Summary
Xdebug installed: no
Server API: LiteSpeed V7.8 CloudLinux 1.2
Windows: no
Zend Server: no
PHP Version: 7.4.13
Zend API nr: 320190902
PHP API nr: 20190902
Debug Build: no
Thread Safe Build: no
OPcache Loaded: yes
Configuration File Path: /opt/alt/php74/etc
Configuration File: /opt/alt/php74/etc/php.ini
Extensions directory: /opt/alt/php74/usr/lib64/php/modules
Instructions
1.Download xdebug-3.0.1.tgz
2.Install the pre-requisites for compiling PHP extensions.
On your RedHat system, install them with:
yum groupinstall "Development tools" && yum install php-devel autoconf automake
3.Unpack the downloaded file with tar -xvzf xdebug-3.0.1.tgz
4.Run: cd xdebug-3.0.1
5.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: 20190902
Zend Extension Api No: 320190902
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
6.Run: ./configure
7.Run: make
8.Run: cp modules/xdebug.so /opt/alt/php74/usr/lib64/php/modules
9.Edit /opt/alt/php74/etc/php.ini and add the line
zend_extension = /opt/alt/php74/usr/lib64/php/modules/xdebug.so
Make sure that
zend_extension = /opt/alt/php74/usr/lib64/php/modules/xdebug.so
is below the line for OPcache.
10.Restart the webserver
You're reading the *nix (Linux) installation instructions.
Install link is at the top of the website.
That brings you to https://xdebug.org/docs/install.
The eighth line on the page: Windows, with help from a wizard.
Brings you to https://xdebug.org/wizard
With instructions to download files from https://xdebug.org/download.
And to copy the contents of your php.ini file in the textarea at https://xdebug.org/wizard.
After following those clear instructions you will need to restart your HTTP server or if you have no idea and don't mind a temporary mindless brute-force (for your current XP) just sacrilegiously reboot your computer.
Here is what is in my WAMP (Windows, Apache, MariaDB, PHP) server's php.ini file for XDebug:
[XDebug]
;When updating server dump phpinfo in to here to determine correct download: https://xdebug.org/wizard.php
zend_extension = "C:\MEDIA\INTERNET\WAMP\PHP\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll"
xdebug.profiler_output_dir = "C:\MEDIA\INTERNET\WAMP\Apache\logs"
xdebug.profiler_append = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = "callgrind.%R-%u.trace"
xdebug.trace_options = 1
xdebug.collect_params = 4
xdebug.collect_return = 1
xdebug.collect_vars = 0
xdebug.profiler_enable=0
xdebug.trace_output_dir = "C:\MEDIA\INTERNET\WAMP\Apache\logs"
html_errors = 0
If installed correctly you should be able to simply append ?XDEBUG_PROFILE to the end of a URL (from your local server). The files will be output to whatever you set for xdebug.profiler_output_dir (use quotes if there are spaces in your local file system's path).
To open the generated logs I recommend using QCacheGrind.
If you get stuck leave a comment. It appears that you're likely having trouble concentrating because the vast majority of the instructions are very easy to access. Additionally you should make an attempt to find search the web before asking questions that are easy to find by...searching the web. Good luck.
Related
So macOS High Sierra 10.13 now comes with PHP 7.1. While configuring Apache I also created a new /etc/php.ini from the /etc/php.ini.default file, made sure to check that is was being loaded by PHP after restarting Apache, however the version of Xdebug extension that ships with macOS 10.13 doesn't seem to load or show up when you run phpinfo();
My php.ini is definitely being loaded:
$ php -i | grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Here's what my /etc/php.ini looks like where I configure Xdebug:
[xdebug]
zend_extension = "/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
[Update, fixed that typo here...]
However, Xdebug doesn't load and checking php -i give no results:
$php -i | grep xdebug
PHP Warning: Method xdebug_start_function_monitor() cannot be a NULL
function in Unknown on line 0
PHP Warning: xdebug: Unable to register functions, unable to load in Unknown on line 0
Segmentation fault: 11
And yes, the path to the file is correct:
$ ls /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so*
This used to work on PHP 5 so I hope someone can help me and anyone else in future struggling with this issue.
When I check my apache log I get the following error:
Failed loading /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so: dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so, 9): Symbol not found: _xdebug_monitored_function_dtor
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
Expected in: flat namespace
in /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
I'm not making progress in terms of find out how I can resolve this error:
Symbol not found: _xdebug_monitored_function_dtor
Ok so I finally got it running myself it works perfectly! I'm assuming that the xdebug binary that comes with macOS High Sierra (found under: /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so) is not compatible with PHP7's new Zend engine.
So I downloaded the latest source from the xdebug website and did the following:
Installed autoconf with brew;
Run phpize to configure the build for the new Zend engine;
Run ./configure
Run make
Now the new binary is under modules/xdebug.so
However macOS System Integrity Protection (SIP) will prevent you from overwriting the xdebug.so under /usr/lib/php/extensions/. I didn't want to disable this so I created a new directory path under /usr/local/lib/php/extensions/ and copied the new binary to this location. I'm not sure if this directory is the best place to put it or if this is bad practice but it worked for me.
Finally I reconfigured my php.ini to use the new binary and everything worked perfectly!
In order to install it you have to have xcode command line tools.
So you need to run:
xcode-select --install
Then you need to install autoconf:
brew install autoconf
Then you have to download the code from here.
After that you have to run in the folder of the source code:
phpize
./configure
make
sudo cp modules/xdebug.so /usr/local/php/extensions (if the directory doesn't exist go and create it)
And finally inside php.ini add
zend_extension=/usr/local/php/extensions/xdebug.so
After that you can enable xdebug inside php.ini and restart apache
sudo apachectl restart
you made a typo in "zend_extention". this should be zend_extension.
and i think the full path is unnecessary
zend_extension=xdebug.so
should be enough
If you have brew installed with multiple PHP versions i.e. 7.1, 7.2 and 7.3 on Mac OS X mojave, you can to do the following:
Install autoconf with brew brew install autoconf.
Change to the PHP version that you want Xdebug on, run brew unlink php#7.1 && brew link --force --overwrite php. This will switch from PHP 7.1 to PHP 7.3.
Download the latest Xdebug source from xdebug website.
Extract the Xdebug tar and navigate to extracted directory, where you'd see all the files.
Run phpize to configure the build for the new Zend engine.
Run ./configure.
Run make.
Xdebug extension xdebug.so gets compiled in modules directory.
Create a new directory path under /usr/local/lib/php/7.3.1/extensions/ and copy xdebug.so to this location. Here, 7.3.1 is the current version that I switched earlier, change this to match your PHP version.
Open php.ini in an editor and enter
zend_extension="/usr/local/lib/php/7.3.1/extensions/xdebug.so" then save the change.
Run php -v and it will show Xdebug has been configured correctly.
If you want to configure Xdebug on another PHP version then just repeat from step 2 all the way to 11. As mentioned in earlier post, this way you don't need to disable/enable System Integrity Protection on Mac OS X.
For anyone arriving late at this party, the initial attempt in the question seems to work just fine in macOS 10.13.6
Hello for everyone that got error trying to install xDebug on Mac.
error: unknown type name 'uint64_t'
There are files in your local/bin/include that causes this error. By removing them you get rid of the error. Though, you might have to reinsatall brew.
https://github.com/cython/cython/issues/2009
I've just installed the latest XAMPP for PHP 5.6 from the official website, and I need to enable Xdebug, I find that the file php_xdebug.dll exists in the C:\xampp\php\ext , but there is no [XDebug] config at all in the php.ini and I have no idea how to make it work. It should be installed by default and pre-configured, we need just to uncomment the xdebug config in php.ini but it's not the case. I even tried to install it again using PECL commmand pecl install xdebug but I get the following error :
pecl install xdebug
downloading xdebug-2.5.0.tgz ...
Starting to download xdebug-2.5.0.tgz (267,640 bytes)
.........done: 267,640 bytes
ERROR: failed to mkdir C:\php\pear\docs\xdebug\contrib
And in PHPStorm when I choose to add the interpreter by selecting the php.exe in the XAMPP directory, it says Debugger : Not installed too.
I re-installed XAMPP, but I still have the same problem.
Thanks in advance.
For more details, you can find a tutorial that explains step by step procedure
php-debugging-with-xdebug-atom-and-xampp
As per this tutorial please follow these steps its works like a charm:
Steps to Install Xdebug:
Download xdebug-2.4.0.tgz
Unpack the downloaded file
# navigate to the downloaded file
$ cd ~/Downloads
$ tar -xvzf xdebug-2.4.0.tgz
$ cd xdebug-2.4.0
run phpize
$ phpize
# example output
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
#Error possibilty
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
#In the above error case you need to install autoconf using below command(MAC) and rerun phpize
$ brew install autoconf
The phpsize command is used to prepare the build environment for a
PHP extension.
Configure it by run:
$ ./configure
run make
$ make
A successful install will have created xdebug.so file.
Steps to Configure Xdebug:
A successful install will have created xdebug.so and put it into the PHP extensions directory.
You must copy this file to XAMPP php extension directory for that
run:-
$ sudo cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303
Finally update /Applications/XAMPP/xamppfiles/etc/php.ini and add
the following lines to it
[Xdebug]
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=On
xdebug.remote_port="9000"
xdebug.profiler_enable=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
Restart Apache using XAMPP’s manager-osx
Congratz! You have completed!! To verify you successfully installed & configured XDebug, open the XAMPP phpinfo.php file in a web browser, for example, http://localhost/dashboard/phpinfo.php.
Search for XDebug section in PHPInfo details. If it exists, you successfully have done your installation
OR
In another browser window or tab, open https://xdebug.org/wizard.php and copy the phpinfo.php page content in the first window or tab and paste it into the textbox on the xdebug.org page. Then submit for analysis, it will give a summary of your installation status.
Safest was is to use XDebug wizard that will give you step by step instructions on how to install on your own machine. Then update your php.ini (tune to your needs)
Note: Wizard will give you instructions for what SAPI it receives phpinfo() contents from. So if you fill CLI phpinfo() output you will get instructions for your PHP CLI. If you paste phpinfo() from a server page you will get instructions for that.
First copy your phpinfor() content form. paste the [xdebug wizard][1] [1]: https://xdebug.org/wizard. then download the xdebug.dll. after that follow this steps
Remove the exists php_xdebug.dill and paste the xampp\php\ext\php_xdebug.dll
update the php.ini like this
[Xdebug] zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=1 debug.remote_autostart=true
I found a solution for xdebug not working even after xdebug has been installed in NetBeans +xampp here. The idea is you have to use all the settings for php.ini mentioned here and not just the usual ones mentioned in forums.
I am searching the way to debug php scripts. In internet i found information that i can do that with MacGDBp + XDebug.
When i'm trying install using PECL in Shell:
sudo pecl install xdebug
The next error have been occured:
downloading xdebug-2.4.0.tgz ...
Starting to download xdebug-2.4.0.tgz (264,832 bytes)
.....................done: 264,832 bytes
76 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
Help me find the way to solve that problem.
XDebug is available by default. Just enable it by
1) sudo nano /etc/php.ini (or sudo cp /etc/php.ini.default /etc/php.ini first if the file doesn't yet exist)
2) Add these lines at the end (verify the path with ls ls /usr/lib/php/extensions/)
[Xdebug]
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
3) Restart apache using sudo apachectl restart
4) Verify by php -m | grep xdebug
Mike Chamberlain's excellent response almost got xdebug working with NetBeans using Mac OS Sierra 10.12. Only two changes required:
In step 2, after
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"
also add
xdebug.remote_enable=1
This was necessary because the precompiled .so file has xdebug remote access disabled. NetBeans and other tools need it to be enabled.
For debugging using xdebug i used the following steps
For installing php72 I installed using brew with the following command:
brew install homebrew/php/php72-xdebug
I added the following command to the bottom of the php.ini file:
zend_extension=/usr/local/Cellar/php72-xdebug/2.6.0/xdebug.so
Note: if you need to search for a version of xdebug with brew use:
brew search xdebug
I've been trying to configure this for quite some time now but I can't get it running properly. Done so far:
Downloaded the latest version of xampp and moved it to /opt/lampp
Installed php5-xdebug with apt-get
Changed implicit_flush to On in /opt/lampp/etc/php.ini
Added the following lines to the end of the ini file:
[xdebug]
zend_extension="/usr/lib/php5/20090626/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_port=9000
xdebug.remote_host="localhost"
I've made sure to restart apache, but I still don't get an xdebug-section when showing phpinfo();
I think that Eclipse is configured properly, but I can't know for sure until I get xdebug to run.
Please help, all suggestions are very welcome!
Edit:
Here is the output of phpinfo(): http://www.pasteall.org/35930
Update:
I've downloaded Xampp 1.8.1 (I had previously xampp 1.8.0) to /opt/lampp and added the appropriate development files. I have both compiled Xdebug myself according to the guide at http://xdebug.org/wizard.php and installed xdebug through /opt/lampp/bin/pecl.
Now my php.ini looks like this:
zend_extension = "/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_host = "localhost"
xdebug.remote_handler = "dbgp"
I don't know what to do, http://xdebug.org/wizard.php still reports that Xdebug isn't installed. Could it be a permission issue? Currently the permissions for the extensions are as follows:
-rwxr-xr-x 1 niklas niklas 88376 Sep 30 10:43 interbase.so
-rwxr-xr-x 1 niklas niklas 184920 Sep 30 10:43 oci8.so
-rwxr-xr-x 1 niklas niklas 118592 Sep 30 10:43 pgsql.so
-rwxr-xr-x 1 niklas niklas 830886 Oct 10 15:10 xdebug.so
Should they be owned by someone else? Must I enable any additional options in php.ini? This is my current output of phpinfo(): http://www.pasteall.org/36135
Tailored Installation Instructions
Summary
Xdebug installed: no
Server API: Apache 2.0 Handler
Windows: no
Zend Server: no
PHP Version: 5.4.4
Zend API nr: 220100525
PHP API nr: 20100525
Debug Build: no
Thread Safe Build: no
Configuration File Path: /opt/lampp/etc
Configuration File: /opt/lampp/etc/php.ini
Extensions directory: /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525
Instructions
Download xdebug-2.2.1.tgz
Unpack the downloaded file with tar -xvzf xdebug-2.2.1.tgzRun: cd xdebug-2.2.1
Run: phpize
As part of its output it should show:Configuring for:
...
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
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 /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525
Edit /opt/lampp/etc/php.ini and add the linezend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so
Restart the webserver
http://xdebug.org/wizard.php
See below URL i think it is very help full to you
http://www.edmondscommerce.co.uk/ubuntu/ubuntu-xampp-xdebug-install/
http://www.webhelp2u.com/article/install-xdebug-on-lampp
https://stackoverflow.com/questions/9640912/problems-setting-up-eclipse-with-xdebug
Read it:-
Install XDebug on ( LAMPP OR XAMPP For Linux )
http://www.edmondscommerce.co.uk/ubuntu/ubuntu-xampp-xdebug-install/
http://www.webhelp2u.com/article/install-xdebug-on-lampp
To Install XDebug on LAMPP
Download the latest version of ( XAMPP For Linux ) From site http://www.apachefriends.org/en/xampp-linux.html
Install it. To install lampp, extract and put in /opt directory.
Download Development package from same site.
Extract it, copy and paste "include" folder from Development package to /opt/lampp directory. ( This package would use for compiling XDebug source )
Run command /opt/lampp/bin/pecl update-channels. this would update the pecl channels database at your local pc.
Run command /opt/lampp/bin/pecl install Xdebug. And wait for finishing the process.
Now xdebug.so file has been created in /opt/lampp/lib/php/extensions/ directory.
Now Open the file php.ini and add the line zend_extension="/opt/lampp/lib/php/extensions/path_to_xdebug.so". at the end of file.
Restart Lampp & Check enabled or not using phpinfo();
Update my answer after your comment
See below URL i think it is very help full to you.
Setup Xdebug for PHP5 in Ubuntu
http://gayanhewa.info/setup-xdebug-php5-ubuntu/
Since there is no sign of why it isn't working I've given up on xampp and just installed a regular lamp-server with xdebug through apt-get. I disabled mysql and apache2 from starting during boot so that they are not running if I don't want them. Here is a very simple tutorial on how to enable xdebug-debugging with Eclipse: http://www.web-brainz.co.uk/Xdebug
The other answers will surely be the most fitting for other users though they unfortunately didn't fix my issue. Thank you very much for help!
On a fresh ubuntu 12.04 run:
apt-get install php5-xdebug
Check for xdebug if it is installed:
php --version
it looks like this:
root#ubuntu-SandBox:/var/www# php --version
PHP 5.3.10-1ubuntu3.19 with Suhosin-Patch (cli) (built: Jul 2 2015 15:05:04)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
root#ubuntu-SandBox:/var/www#
Modify your php.ini to load Xdebug run:
vi /etc/php5/apache2/php.ini
and add at the bottom of the file:
[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_port=9000
/* this is the ip address of your PHPstorm IDE machine. */
xdebug.remote_host="10.70.111.11"
Restart your server:
service apache2 restart
Now your server is ready for your client IDE machine to connect.
Here is how to configure PHPSTORM:
Follow this instruction of JetBrain https://confluence.jetbrains.com/display/PhpStorm/Validating+Your+Debugging+Configuration
or
On menu Run => Web Server Debug Validation and you will see something like this:
If you dont get the yellow and everything is blue you are good!
Install chrome extension xdebug helper from here:
https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en
Start a debug session in browser by enable this extension by click on it and the bug icon turns green.
Then in IDE Run => Listening for php debug connections.
Set a breakpoint in the source code
Load your php page (webapp) and it will be stopped at breakpoints.
Done.
I am trying to follow this article:
http://robshouse.net/article/xdebug-komodo-and-acquia-drupal-stack-installer
I did all of that, yet XDebug is still not being loaded or shown on phpinfo.
Has anyone got this to successfully work?
I installed XDebug with Homebrews, brew install xdebug. I copied xdebug.so to my acquia stack folder, /php/ext/xdebug.so and added the approrpiate lines to php.ini, restarted the stack and Apache and no luck.
Tried a few different articles and have not had success.
My php.ini:
[debug]
; Remote settings
zend_extension=/Applications/acquia-drupal/php/ext/xdebug.so
xdebug.remote_autostart=off
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
This is reported in my apache errors:
Failed loading /Applications/acquia-drupal/php/ext/xdebug.so
But the file does exist there.
The author of robshouse.net moved his website to Drupal Gardens and did not migrate the article linked to in the question. However the article is somewhat outdated.
You do not need to download anything to enable xdebug in current versions of Acquia Dev Desktop.
Simply uncomment the line that mentions xdebug in /Applications/acquia-drupal/php5_*/bin/php.ini. There are three of these for PHP versions 5.2 5.3 and 5.4 respectively. Make the change in all of them (unless you know better).
You will need to stop and start Acquia Dev Desktop for the change to take effect.
For php -v 7.0.3 users:
ssh: Brew update && upgrade
ssh: brew install homebrew/php/php70-xdebug
ssh: php -m
Check that the module is installed. Then copy the entire
usr/local/Cellar/php70/7.0.3/ content to - >
Applications/DevDesktop/php7_0/
ssh: nano /usr/local/etc/php/7.0/php.ini
configure xdebug.so:
ssh: sudo cp /usr/local/etc/php/7.0/php.ini
/Applications/DevDesktop/php7_0/bin/
DONE :-)
I didn't get the XDebug to work either with Homebrew.
Get the working xdebug.so from ActiveState.
http://code.activestate.com/komodo/remotedebugging/
Article about this:
http://debuggable.com/posts/setting-up-xdebug-on-mac-os-x-or-win32-linux:480f4dd6-0240-4a90-8fa1-4e41cbdd56cb