Author: Cyril Ogana
Updated on: 2016-06-28
Posted on: 2016-06-28
Categories: PHP Tutorials, Sponsored
IDEs like PHPEd support remote debugging. You do not need to download the project files from the production server to debug your project remotely. Thanks to the remote projects feature of PHPEd, it can retrieve only the server files that you need to debug so you can start debugging remote projects very quickly.
Read this article to learn how to setup and use PHPEd to debug remote projects running in production server for instance.
Remote access to projects is needed by software developers that need to debug projects that are running in other machines, those being in production or testing machines, or even virtual machines running locally.
A software team can achieve great productivity gains when working with an IDE that supports remote debugging.
Example of Remote Projects and Applications
Remote debugging involves working from your local computer on software that is on another computer, the remote machine.
Our firm relies heavily on cloud platforms. I would say 80% of the infrastructure is on the cloud, and is often accessed by engineers and developers in different locations of the country at any given time. Majority of the applications we develop and use are PHP based.
The remote stack of our PHP applications consists of among others:
1. Linux environment test server (Centos 6.5)
2. Ioncube Licensing Server (Windows Server 2012)
3. Windows environment test server (Windows 2008 R2)
4. Accounting software (Windows Server 2008 R2)
5. Mobile transactions server (Centos 6.5)
The team may need to access any of these servers. At times, they are accessed by consultants who telecommute, or work from the client site. Thus remote access for debugging may be required at any point in time in such an environment.
Overview of Remote Debugging and Remote Projects
PHPEd IDE allows you to use the same debugging techniques on a remote server that you can use with local server. In this article, I will demonstrate a debugging session of the PHP based CRM named X2-Engine remotely using PHPEd IDE.
Remote projects allow developers to handle files in a remote server as if they were local. Actually it can retrieve just the necessary files from the remote server so you do not have to wait to download the whole project files.
We will look at how we can create remote projects to our headless Linux Server to enable developers access the project using the IDE.
While remote projects are rather straightforward, remote debugging will take a bit of setting up on the IDE to ensure that it works correctly. To give you a quick understanding of the process, below you can see a image from the PHPEd forums which highlights well what happens during a remote debugging session.
Remote Debugging and Remote Projects: Customizing X2CRM
Creating The Remote Project on the Linux Server
Our test server runs on Centos 6.5. We have several Web based projects running there. Our latest project involved uploading of X2 Engine CRM to the server. This is a Yii based framework, a framework that is also supported by the IDE.
Being a test environment, developers may be required to log in to tweak certain parameters as well as to work on source code remotely. Testers also log in to write, update and run tests. Listed below is th base directory of the CRM
Setting Up FTP Accounts in the Linux Server
Remote projects may use a variety of file transfer protocols. FTP and SFTP protocols are supported. For the Linux server, we have an FTP account for each developer who is authorized to log in remotely. I am not covering setting up of FTP server on Centos.
Setting Up the FTP Accounts in PHPEd IDE
Type the FTP account credentials and save the profile. It would be nice to see a test connection feature here added by the PHPEd team which would enable you know if you have already configured the account correctly prior to beginning your coding.
Prior to connecting to your project server, you should verify that the ports required for FTP or SFTP are opened in your server, to avoid having unnecessary connection errors when your developers are trying to create the remote project.
Creating a Remote Project
Next, select the appropriate directory under the FTP section of the Directory listing. If you get an error when trying to expand the FTP tree, verify your FTP settings again in the IDE accounts menu, or verify that your firewall settings appropriately have authorized the ports required by FTP to connect.
Most of our servers run on AWS. We added the below to the inbound security rules on the Centos 6.5 server in order to allow FTP access.
Because the remote web server did not have DBG installed and configured, the health checks did not complete.
I had to copy the dbg-php-5.6.so file to the server to enable the DBG wizard to work. This file is located in C:/Program Files/NuSPhere/debugger/server/dbg-x.x.x-YourPlatform.tar.gz.
For my case it was dbg-8.1.5-Linux.tar.gz. We are using PHPEd 17. This was done via FTP. It is important that all your checks go through to ensure your developers are able to work comfortably.
Upon taking 5 minutes to install the required .so and make the changes in php.ini on the remote server, we are able go get a clean bill of health on all the checks.
I opted out of SSH connection:
Running a Remote Debugging Session
Our assignment with this particular CRM was to override default X2Engine parameters which have been boiler-plated. We will be stepping into the bootstrap process that the CRM does. Being a YII based software, requests are routed through the index.php file, which is the file that will launch into a debug session.
You may get the IDE failing to launch the session after showing the "Loading debug session" message for a while. This is likely a port issue and you need to check if your debug port (default 7869) is open.
You can see that we were able to connect to the remote server and make our CRM customizations on x2Engine remotely. Such applications are usually very customer centric thus can allow your remote team of developers to work from the comfort of their remote office or home.
If you would like to try this remote projects feature for debugging with PHPEd you can try it for free downloading the 32 bit or 64 bit version from this page.
If you have a question about debugging of remote projects, post a comment here.
You need to be a registered user or login to post a comment
Login Immediately with your account on: