Install xdebug in centos7 with php7

I just realised I dont have a post on how to install xdebug in centos7 with php7 and setting up xdebug and eclipse. Its a feature that I use every day, and I had assumed I already had a post, but when searching my site ) only found instructions for XAMPP and xdebug.
I’m assuming you already have apache / php installed and working, and that you only need to add xdebug. This post shows how to install xdebug in centos7 with php7.
If you dont alreay have php7 installed in your centos7, you can follow my other post here. Once you have php7 installed, you can then install xdebug with the following:

Install xdebug in centos7 with php7

if you have php7 in centos7 with webtactic and epel you can install xdebug with the following

yum install php70w-pecl-xdebug.x86_64

if you have epel and webtactic, but not php7 you can install xdebug with:

yum install php-xdebug

Now that xdebug is in your sytstem its time to confgure xdebug

  • open /etc/php.d/xdebug.ini in your favourite editor
  • add the following lines

	#this line will be added automatically
        zend_extension = /usr/local/lib/php/extensions/xxx/
        #add the following
	xdebug.profiler_enable = 1

You can find the correct paths to the files needed if you have yum-utils installed and run

	repoquery --list  php70w-pecl-xdebug
	# the output is:

You now need to restart httpd

service httpd restart
# or
systemctl restart  httpd.service

Xdebug will now be up and running


Inside eclipse, goto preferences > php > debuggers
change the debugger to xdebug
click configure
change the dropdown for “accept remote session (JIT)” to “any” or “prompt”
click ok


Easy Xdebug is the best solution I have found for firefox – simply install the extension from here, navigate to the site you want to debug, and click the little green bug to open in your editors debugger. you might need to add the key you added to your xdebug.ini in the previous steps.