The best solution for joomla-php remote debugging (Xdebug)

Source: Internet
Author: User
I am using Joomla to do some small sites and applications, sometimes in order to customize the function of the page and module, need to modify some PHP files. When it comes to more complex classes, it's inconvenient to use var_dump, so make up your mind to learn how to debug PHP. Since I'm not building the whole project, I'm tinkering with a website that's already running, so I want to connect to the virtual server from my own computer for remote debugging. On this remote debugging, I read a lot of documents, but also made a lot of attempts, is still no avail.

What I want to make sure is, does remote debugging need to create a local version of the remote Web site or app first? So a lot of people told me I had to have a local version, but I always thought it would be very troublesome. Because if I download the entire Joomla site today after the debugging made some changes to upload back, tomorrow I updated some extensions for this site, articles and plugins, the day after tomorrow I want to do some debugging when you have to download the whole site again? You know Joomla Web site file a lot, copy download to 5-10 minutes or so, if every debugging to download again, then I might as well use var_dump forget, although primitive but also can deal with.
(There is a versioning issue involved.) I'm not very familiar with git, but git is also an acceptable solution if git makes it easy for me to synchronize a debugged local site to a remote server. )
Next, so I've been looking for a way to debug on a remote server that allows me to connect directly to it from my computer. Although I'm not quite sure if this is technically feasible, some of the articles I see seem to imply that this is possible, such as this: Remote debugging in Phpstorm via SSH Tunnel, I follow the instructions in this article to set, But there are still a lot of things that don't understand. I think it's best to ask questions in another question.
This question is mainly about remote debugging "common practice", exactly like my situation should adopt what kind of debugging strategy is better? People see I wrote so much to know that I am really very sincere questions, look forward to the master of all the way to enlighten.

Reply content:

I am using Joomla to do some small sites and applications, sometimes in order to customize the function of the page and module, need to modify some PHP files. When it comes to more complex classes, it's inconvenient to use var_dump, so make up your mind to learn how to debug PHP. Since I'm not building the whole project, I'm tinkering with a website that's already running, so I want to connect to the virtual server from my own computer for remote debugging. On this remote debugging, I read a lot of documents, but also made a lot of attempts, is still no avail.

What I want to make sure is, does remote debugging need to create a local version of the remote Web site or app first? So a lot of people told me I had to have a local version, but I always thought it would be very troublesome. Because if I download the entire Joomla site today after the debugging made some changes to upload back, tomorrow I updated some extensions for this site, articles and plugins, the day after tomorrow I want to do some debugging when you have to download the whole site again? You know Joomla Web site file a lot, copy download to 5-10 minutes or so, if every debugging to download again, then I might as well use var_dump forget, although primitive but also can deal with.
(There is a versioning issue involved.) I'm not very familiar with git, but git is also an acceptable solution if git makes it easy for me to synchronize a debugged local site to a remote server. )
Next, so I've been looking for a way to debug on a remote server that allows me to connect directly to it from my computer. Although I'm not quite sure if this is technically feasible, some of the articles I see seem to imply that this is possible, such as this: Remote debugging in Phpstorm via SSH Tunnel, I follow the instructions in this article to set, But there are still a lot of things that don't understand. I think it's best to ask questions in another question.
This question is mainly about remote debugging "common practice", exactly like my situation should adopt what kind of debugging strategy is better? People see I wrote so much to know that I am really very sincere questions, look forward to the master of all the way to enlighten.

Directly in the production server debugging is obviously not the solution, that requires a development server
Debugging is the most convenient when the development server is local

Data and code synchronization is a small problem git doesn't need 10 minutes every time.

Git will be slow to clone for the first time, and only the files that have changed have been updated later. My own development is a local set of environment online environment, and then use git synchronization code, data can be part of the online debugging.

In short git really is very convenient, git learning material is also very much, learning basic usage also can not spend much time. Compared to copying this way ... Git you are so worth having.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.