Build debug environment for Phalcon + Vagrant + centos + xdebug + phpstorm

1. Install xdebug

vagrant ssh
sudo yum install --enablerepo=remi-php72 php-xdebug -y

Check the location of the Xdebug module

sudo find / -name "xdebug.so"

Editing php.ini

sudo vi /etc/php.ini

Finally added below Host is set to 10.0.2.2 for vagrant

[xdebug]
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=10.0.2.2
xdebug.remote_port=9001
xdebug.idekey="phpstorm"
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp

Server restart

sudo systemctl restart php-fpm
sudo systemctl restart nginx

Create a php.info file and succeed if info shows xdebug configuration related

2. phpstorm settings

Be especially careful as you are frustrated

  1. Select remote for language setting スクリーンショット 2020-09-22 16.21.29.png

  2. Debug settings:

スクリーンショット 2020-09-22 16.22.53.png

IDE key and host settings (host has already been set in vagrant.file) スクリーンショット 2020-09-22 16.23.50.png

  1. server settings Be especially careful by mapping the folder path

スクリーンショット 2020-09-22 16.25.21.png

The local path is the root of the project, not public. スクリーンショット 2020-09-22 16.26.34.png

The path of the virtual environment is also the root. スクリーンショット 2020-09-22 16.27.50.png

  1. Complete Debug settings: Set remote debug スクリーンショット 2020-09-22 16.28.45.png

Start-up: スクリーンショット 2020-09-22 16.35.46.png

Recommended Posts

Build debug environment for Phalcon + Vagrant + centos + xdebug + phpstorm
[2021] Build a Docker + Vagrant environment for using React / TypeScript
Build Spring for Android 2.0.0 environment
Build Java development environment (for Mac)
Build Virtual Box & Vagrant & Centos7 & GitLab
Build Virtual Box & Vagrant & Centos7 & Artifactory
Build debug environment on container --Build local development environment for Rails tutorial with Docker-
Install PHP7.4 to build CentOS7 Laravel environment
Countermeasures for FDclone build failure on CentOS 8
Build a development environment for Docker + Rails6 + Postgresql
Build a development environment for Docker, java, vscode
How to quit Docker for Mac and build a Docker development environment with Ubuntu + Vagrant