1

Scenario: We have code on our local machine and are remotely handling the code and database on a Remote Server (Virtual Machine).

Now we want to Debug our Code.

This is how we have configured Remote Debugging:

php.ini Code

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=192.168.0.185 //My Local IP
#export PHP_IDE_CONFIG="192.168.0.120" // Remote IP
xdebug.remote_port=9000
xdebug.remote_log="/tmp/xdebug.log"
xdebug.remote_cookie_expire_time=10000
xdebug.remote_timeout=5000
xdebug.profiler_enable = 1
xdebug.remote_enable=on
xdebug.idekey=phpstorm-xdebug
#xdebug.remote_connect_back =On

Most of these settings are working properly until the end of the process. We have created the configuration based on this Link

Main Question is when we are debugging my instance, it is not properly working and not stopping on Breakpoints.

0

first check if xdebug already installed using commands

$ php -v display php version and mention if xdebug is installed or $ php -i display all information about php and it extensions $ php -m displays all php extension

after that we install xdebug using the command line

$ sudo apt install php-xdebug

we can check if xdebug was enabled automatically by typing the command line php -m

after that we need to configure xdebug

in /etc/php/version/mods-available/xdebug.ini

and add the following lines

xdebug.remote_enable=1 xdebug.remote_host=192.168.66.7 (host machine ip)

for more information visite

https://xdebug.org/docs/all_settings

after that restart services for me I am too lazy I restart apache2 services that will restart all it subsequence services with it

$ service apache2 restart

moving on to host machine here we will install google chrome extension xdebug that will add flag to the request

after that we configure IDE in my case I use phpstom

open your project using phpstorm then go to run >> edit configuration

then create new php remote debug

and click in validate link

to start listening click on the icon green bug

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.