Starting Out With PHP

MadDoc

macrumors 6502
Original poster
Apr 25, 2005
321
3
UK
I am trying to learn how to develop web applications using PHP and MySQL. I have a strong background in REALbasic and (in my pre-Mac days) VisualBASIC. It's a steep learning curve but I shall persevere.

I am currently using this book as my reference text.

I have a few questions:

1. How do I set up PHP and MySQL on my MacBook Pro (OS X 10.4.10) so that I can test scripts offline? Are there any walkthroughs for beginners?

2. Can anyone recommend a good editor for PHP with syntax colouring, etc.

3. What HTML editor do people recommend?

Many thanks,

MadDoc
 

MacDonaldsd

macrumors 65816
Sep 8, 2005
1,009
0
London , UK
for question 2&3

I use Textmate, they have a 30 day trial for it.

Does nice color coding for PHP/HTML and doesn't get in the way of developing.
 

Mitthrawnuruodo

Moderator emeritus
Mar 10, 2004
13,604
146
Bergen, Norway
1. MAMP might be the easiest way of getting a full PHP/MySQL environment up and running in no time...

2 and 3. Both PHP and HTML are text only, so all you need is a nice text editor. My favourites are: The free TextWrangler (along with Cyberduck if you need an alright free s/ftp client) or the $79 Coda ($69 if you already own Transmit, a very nice s/ftp client costing $29).

Now, that should get you started.

Oh, and of course feel free to browse around the Web Design and Development forum for more tips and information.
 

MadDoc

macrumors 6502
Original poster
Apr 25, 2005
321
3
UK
Thanks for the great tips guys.

I've taken a look at MAMP and am downloading it - it seems to be exactly what I am looking for. What I am unclear about is that it talks about setting up a local server? I'm not quite sure about what this entails. I just want to be able to run local php files on my computer in my browser window. Why do I need to set up some form of server? (You can tell I am only just starting out in the world of web development!).

I really like the look of coda - it seems like a beautiful app. I will download the trial and see how I get on with it.

MadDoc,
 
What I am unclear about is that it talks about setting up a local server? I'm not quite sure about what this entails. I just want to be able to run local php files on my computer in my browser window. Why do I need to set up some form of server? (You can tell I am only just starting out in the world of web development!).
When it sets up a local server this means that anyone on your lan (local area network) can access it. Basically, other people on you LAN can see the websites you're working on by typing your local IP address into their browser window.

As far as I know, the only way to not let other people access the site from the lan is to add a password, but I am not completely sure about the solution.

To access the site from your machine http://127.0.0.1 should work
 

thejadedmonkey

macrumors G3
May 28, 2005
8,005
550
Pennsylvania
Thanks for the great tips guys.

I've taken a look at MAMP and am downloading it - it seems to be exactly what I am looking for. What I am unclear about is that it talks about setting up a local server? I'm not quite sure about what this entails. I just want to be able to run local php files on my computer in my browser window. Why do I need to set up some form of server? (You can tell I am only just starting out in the world of web development!).

I really like the look of coda - it seems like a beautiful app. I will download the trial and see how I get on with it.

MadDoc,
The output, or to get data from a database, it needs to be parsed. to do that, it needs to go through the server. Straight up HTML can just be read from disk, but PHP needs to be read by a browser from the server, otherwise it'll read and try to output PHP as thought it is HTML.
 

pengu

macrumors 6502a
Mar 20, 2005
581
0
Diddily Daddily...
just remember, when we say "set up the server" we mean setup the Apache/PHP/MySQL server SOFTWARE, we don't mean a physical server.

and for the coding, i'd recommend Komodo Edit to start off (free) and when you get a bit more experienced, Komodo IDE will be of benefit to you (license)