2014-08-02

PHP Debugging tips and techniques (Part 1)

PHP is a script based language. It does not require a compilation process. Errors can only be detected when you run the PHP code.

Tip #1 - setup a development environment on your own machine. 

With the available of cheap PHP hosting, some PHP developers just use a text editor to write the code. Then upload the php file directly to the PHP server using FTP, and test using the PHP server. If there are any errors in the PHP file, they would be obvious when the you try to view the page on the browser.

When it comes to debugging, this is a very slow and tedious process of finding a bug, the correcting (at least hope to) and uploading the new version of the php file and testing with a browser. It would probably take far less time, to setup the development environment on your machine. At the very least, it would save you the hassle of repeatedly uploading the file to the server.

A number of pre-packaged installers exists for windows and macosx and linux

https://www.apachefriends.org/index.html
Mac, Win, Linux

http://www.easyphp.org/
Win

http://www.mamp.info/en/
Mac



No comments:

Post a Comment

Github CoPilot Alternatives (VSCode extensions)

https://www.tabnine.com/blog/github-copilot-alternatives/