Developing web pages in PHP

Most web space these days comes with the PHP language, usually running on the Apache webserver, with the MySql database.  When developing scripts of one’s own, ideally one replicates this on the PC.  But frankly, installing all this stuff is a faff.

This week I came across the Wampserver package.  This allows you to install all three items in one go, and has a single menu to start (and stop) the lot.  It doesn’t install a load of things that you then have to manually disable, and it just works out of the box fine.

I’ve used Notepad++ for most such scripting, but this is rather underpowered.  Instead I have been using lately Eclipse for PHP, the PDP development tools (PDT) version.  This likewise works well.  If you are a Java developer, with an Eclipse setup, you can relax — it unzips to a different directory, and doesn’t interfere at all.  You can run, thus, two different versions of Eclipse quite happily.

For unit testing I’ve been using SimpleTest.  You get the software and unzip to a directory on your C: drive.  There is an obsolete eclipse plugin for this — which no longer works and ought to be updated.  But you can run SimpleTest just fine in eclipse anyway, using the following instructions:

  1. download and install SimpleTest.
  2. put a require_once('autorun.php'); at the top of the test file.

    note: this requires the SimpleTest directory containing autorun.php to be in your include_path. alternatively, you can include autorun.php by full path, like require_once('C:/full/path/to/your/Simpletest/autorun.php');. it might even be possible not having to change the test file by including autorun.php via auto_prepend_file.

  3. run the test by right clicking on the test file and select “Run As PHP Script”
  4. the output from the testing shows up in the eclipse console

Although in my case it doesn’t show up in the console, but as a web page, so long as Wamp has been started.

Share

One thought on “Developing web pages in PHP

  1. If you are looking for a good full-feature replacement for notepad++, I would recommend sublime Text 2 (http://sublimetext.com). While not a replacement for a full featured IDE such as eclipse, it is generally much faster and (in my opinion) easier to use.

    Coupled with the package control plugin (http://wbond.net/sublime_packages/package_control), you have access to a wealth of development tools such as unit testing (via phpunit) and linting, across a variety of programming and markup languages.

    Also, I don’t know how or for what you wish to use php, but a couple good php frameworks for rapid development are fuelphp (http://fuelphp.com) and laraval (http://laravel.com). For example, both have built in ORM, REST, MVC/HMVC, profiling and unit testing.

Leave a Reply