Whats the best PHP dev tool\ide to create and build a PHP web service ?

Very quick question, can anyone recommend a good dev studio\IDE to develop a PHP REST based webservice on? As im a complete noobie to PHP, the only requirements are that the IDE be simple to use (almost wizard like if possible) and most importantly free.

Thanks in advance
wilko100Asked:
Who is Participating?
 
Ray PaseurConnect With a Mentor Commented:
For a RESTful web service, the advice from MunterMan is spot on.  You will need to learn PHP from the ground up and you will want to handcode your script.

I use Textpad or BBEdit; I find that IDEs get in my way.  For a "build" I use FTP.  I never test my scripts on a local machine.  I always test in the expected environment.

Here is how I do it.  First, I write the basic PHP hello world script like this:
<?php // hello.php
error_reporting(E_ALL);
echo 'Hello World';

Open in new window

I use FTP to send that script to a live web server on the internet.  Then I visit the web site, and go to the URL of the script.  In a RESTful web service, all of the script output goes to the browser output stream, so if I see "Hello World" when I visit the URL, I know I've got the script working correctly.  Then I start adding code to perform other functions.  Make a lot of tests along the way; you want to eat the elephant one bite at a time.  It's good to avoid large debugging projects.

This book will not make you a pro, but it will help you get a foundation in PHP.  It's very readable and has good examples, as well as a code library that you can download and modify for your own purposes.
http://www.sitepoint.com/books/phpmysql5/

Here is an example of a RESTful web service.  You can test it on my server with this sample URL.
http://laprbass.com/RAY_REST_get_last_name.php?key=ABC&resp=XML&name=Ray

<?php // RAY_REST_get_last_name.php
error_reporting(E_ALL);


// DEMONSTRATE HOW A RESTFUL WEB SERVICE WORKS
// INPUT FIRST NAME, OUTPUT FAMILY NAME
// CALLING EXAMPLE:
// file_get_contents('http://laprbass.com/RAY_REST_get_last_name.php?key=ABC&resp=XML&name=Ray');


// OUR DATA MODEL CONTAINS ALL THE ANSWERS - THIS COULD BE A DATA BASE - AS SIMPLE OR COMPLEX AS NEEDED
$dataModel
= array
( 'Brian'   => 'Portlock'
, 'Ray'     => 'Paseur'
, 'Richard' => 'Quadling'
, 'Dave'    => 'Baldwin'
)
;

// RESPONSE CAN BE PLAIN TEXT OR XML FORMAT
$alpha = NULL;
$omega = NULL;
if ( (isset($_GET["resp"])) && ($_GET["resp"] == 'XML') )
{
    // PREPARE THE XML WRAPPER
    $alpha = '<response>';
    $omega = '</response>';
}


// TEST THE 'API KEY' - THIS COULD BE A DATA BASE VALIDATION LOOKUP - AS SIMPLE OR COMPLEX AS NEEDED
$key = (!empty($_GET["key"])) ? $_GET["key"] : FALSE;
if ($key !== 'ABC')
{
    echo $alpha . 'BOGUS API KEY' . $omega;
    die();
}


// LOOK UP THE FAMILY NAME
$name = (!empty($_GET["name"])) ? $_GET["name"] : 'UNKNOWN';

// IF THE NAME FROM THE URL IS FOUND IN THE DATA MODEL
if (array_key_exists($name, $dataModel))
{
    // RETURNS THE APPROPRIATE FAMILY NAME FROM THE DATA MODEL
    echo $alpha . $dataModel[$name] . $omega;
    die();
}

// RETURNS THE UNKNOWN NAME INDICATOR
else
{
    echo $alpha . 'UNKNOWN' . $omega;
    die();
}

Open in new window

HTH, ~Ray
0
 
Chris HarteConnect With a Mentor ThaumaturgeCommented:
The best ide is a matter of opinion. Mine says that eclipse pdt is the best and not just because it is free. But it does not do any of the work for you. If you wish to build a web service, you are going to have to learn to code and do it the old fashioned way.

[The latest version of eclipse is Juno. It has a lot of performance issues especially with pdt, so go for the previous edition Indigo.]
0
 
Andrew DerseConnect With a Mentor IT ManagerCommented:
I personally use Dreamweaver, but I've seen many developers use Eclipse.

A few other options are:

HTML Kit
Aptana

Also, check here for a good listing of these...
http://en.wikipedia.org/wiki/List_of_PHP_editors
0
 
Derek JensenConnect With a Mentor Commented:
I have used both HTMLKit and Aptana(which is built on top of the Eclipse platform); there's also NetBeans or your favorite flavor of text editor. :)

I enjoyed using HTMLKit, but it didn't suit my needs, specifically; Aptana has always been my fav. since the beginning, but that's probably because that's what I learned PHP on. That, and it has the best regex support I've ever seen in any editor.

That doesn't necessarily mean it's the best choice for you, of course. ;-)
0
 
wilko100Author Commented:
Thanks for the input, just installed the PDT for Eclipse so will go with that
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.