This is a memo for setup the Laravel debug environments that using the Eclipse Oxgen. It’s included synchronized project setup and debug setup. Let’s get started.

Package version:

Eclipse: Oxygen.2 Release (4.7.2)

xdebug: php-pecl-xdebug.x86_64          2.6.0-1.el7.remi.7.0

Vagrant: Vagrant 2.0.2

Laravel: Laravel Framework 5.5.35

1. Laravel setup

See Laravel 5.5: Vagrant + Nginx + PHP + MySQL + CentOS setup

2. Eclipse PDT download

2.1 Go to package list page. Click [64bit] right side of the Eclipse for PHP Developer. Click [DOWNLOAD]. dmg(eclipse-php-oxygen-2-macosx-cocoa-x86_64.dmg) file will be downloaded.

2.2 Double click dmg file. then install Eclipse into Application.

3. Eclipse setup

3.1 Launch Eclipse, then close initial view by click [X] in tab.

3.2 Open the Preferences, then go to the Remote connections

3.3 Click [Add] to create configuration. Put appropriate value. then click [Finish]

3.4 Check SSH key stored location by command “vagrant ssh-config”, then put key into private key on SSH2 panel. Click [Apply and Close]

3.5 Exclude some file types (.ptp-sync, .ptp-sync-folder) for synchronize. After added two types. Click [Apply and Close]

3.6 Create Synchronized Project. [File] -> [New] -> [Project] -> [Synchronized PHP Project] -> [Next]. Put appropriate value. * Click [Finish]

* Before Click [Finish], you should have change the permission /usr/share/nginx as 777. because above exclude filter doesn’t effect top folder.

3.7 Synchronize has been done. (a few minutes needed)

* Many error happened, Does someone know how to resolve these error?

4. Debug

4.1 Before proceeding Eclipse setup. Xdebug install should be done.

* Don’t forget reboot after setup completed.

[root@localhost app]# yum -y install --enablerepo=remi,remi-php70 php-pecl-xdebug
[root@localhost app]# vi /etc/php.d/15-xdebug.ini
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_host = 10.0.2.2
xdebug.remote_port = 9001
[root@localhost app]# reboot

4.2 Back to Eclipse. [Run] -> [Run Configurations…] then click “PHP Web Application”. Put “index.php” into File. Uncheck “Auto Generate”. Also put “/index.php” into URL. click [Apply]

4.3 Click [Configure]. Put server IP address as 192.168.33.10 into Base URL. then click Browse and choose local project directory.

4.4. Click [Debugger] tab. Debugger: set to “XDebug”. Port set to 9001. then Click [Global Settings]. Debug Port: 9001, Accept remote session (JIT): prompt or (any), Both Capture settings: off. then [OK]

4.5 Click [Path Mapping]. Put appropriate paths. Click [OK]. then [Finish]

4.6 Debug. Set break point by double click on the number on source code. Click right side of bug button. then choose New_configuration.

4.7 When reach the break point, debugger will be stopped. you can see variables or run by steps.

Hope this will help you. 😄