I am using joomla to do some small websites and applications. Sometimes I need to modify some PHP files to customize the page and module functions. It is inconvenient to use var_dump when complicated classes are involved, so we are determined to learn how to debug PHP. Because I am not building the entire project,... I am using joomla to do some small websites and applications. Sometimes, to customize the page and module functions, I need to modify some PHP files. It is inconvenient to use var_dump when complicated classes are involved, so we are determined to learn how to debug PHP. Because I am not building the entire project, but repairing and completing the project on a website that has already been set up for running, I want to connect my computer to the virtual server for remote debugging. For remote debugging, I have read many documents and made many attempts.
I want to confirm whether "remote debugging" requires creating a local version for a remote website or application first? SO many people tell me that I must have a local version, but if SO, I always feel very troublesome. For example, if I downloaded the entire Joomla website and made some modifications and uploaded them back today, I will update some extensions, articles, and plug-ins for the website tomorrow, do I have to download the entire website again when I want to perform some debugging the day after tomorrow? As you know, there are a lot of Joomla website files. It takes about 5-10 minutes to copy and download the files. If you need to download the files for each debugging, it would be better for me to use var_dump, although primitive, it can also be dealt.
(A version control problem is involved here. I am not familiar with git, but if git allows me to easily synchronize the local website after debugging to a remote server, git is also an acceptable solution .)
Therefore, I have been searching for methods that can allow me to directly connect to a remote server from the Local Machine for debugging. Although I am not sure whether this is technically feasible, some articles I have seen seem to imply that this is acceptable. For example, in this article: Remote debugging in PHPstorm via SSH tunnel, I followed the instructions in this article, but there are still many things I don't understand. I think it is better to put these questions in another question.
This is mainly about "common practice" for remote debugging. What debugging policies should be used in my case? As you can see, when I write so much, I am very sincere to ask questions. I hope that you will be enlightened by other experts.
Reply content:
I am using joomla to do some small websites and applications. Sometimes I need to modify some PHP files to customize the page and module functions. It is inconvenient to use var_dump when complicated classes are involved, so we are determined to learn how to debug PHP. Because I am not building the entire project, but repairing and completing the project on a website that has already been set up for running, I want to connect my computer to the virtual server for remote debugging. For remote debugging, I have read many documents and made many attempts.
I want to confirm whether "remote debugging" requires creating a local version for a remote website or application first? SO many people tell me that I must have a local version, but if SO, I always feel very troublesome. For example, if I downloaded the entire Joomla website and made some modifications and uploaded them back today, I will update some extensions, articles, and plug-ins for the website tomorrow, do I have to download the entire website again when I want to perform some debugging the day after tomorrow? As you know, there are a lot of Joomla website files. It takes about 5-10 minutes to copy and download the files. If you need to download the files for each debugging, it would be better for me to use var_dump, although primitive, it can also be dealt.
(A version control problem is involved here. I am not familiar with git, but if git allows me to easily synchronize the local website after debugging to a remote server, git is also an acceptable solution .)
Therefore, I have been searching for methods that can allow me to directly connect to a remote server from the Local Machine for debugging. Although I am not sure whether this is technically feasible, some articles I have seen seem to imply that this is acceptable. For example, in this article: Remote debugging in PHPstorm via SSH tunnel, I followed the instructions in this article, but there are still many things I don't understand. I think it is better to put these questions in another question.
This is mainly about "common practice" for remote debugging. What debugging policies should be used in my case? As you can see, when I write so much, I am very sincere to ask questions. I hope that you will be enlightened by other experts.
Debugging directly on the production server is obviously not a solution, so a development server is required.
Debugging is the most convenient when the development server is local
Data and Code Synchronization is a small problem. git does not take 10 minutes every time.
When git is cloned for the first time, it slows down, and only the modified files are updated later. I developed a local environment on my own. I used git to synchronize code and debug some of the data from the online environment.
In short, git is really convenient, and git has a lot of learning materials, so it takes little time to learn the basic usage. Compared with copying... Git is worth it.