Starting PHP page 1. Setting up a development system.

Want to support HowtoForge? Become a subscriber!
 
Welcome to the real PHP world :)

I want to learn php as quick as possible. What do I need to do?
First things first.. You need to set up a development system. So you can start writing scripts and test them.

In this first part you will learn how to set up an windows pc to become a php development studio :).

Steps to be taken:

1. Installing IIS for windows XP pro
2. Installing mysql
3. Installing PHP 5 for windows
4. Installing html-kit (I like this editor)
5. Links (using Apache instead of IIS, Dev system on MAC OS)

1 Why in the name of God do you use IIS?

Ok why IIS on windows XP pro and why not Apache? IIS is not free and not so secure!
All true but the main reason for this is because IIS is easy to set up on a windows machine. It is already there J. It has enough licenses to use it with a single client (the developer) and because it is a development system you will use IIS only from the local host. You won’t need security then right?

So how to set it up?
Easy. Just go to start->configuration panel (cp) -> add/remove software.
Press the third icon on the left (add windows programs) and then check Internet information services. Follow the wizard (place you winXP cdrom in the cdrom drive) and your ready.

really that easy? yeah.
You will find a folder inetpub under you system drive (mostly c:) in this inetpub folder you will find wwwroot. And in this folder you can make new folder for each website you create.
You can view your site by opening up a browser (firefox for example) and fill in the address bar http://localhost/<map name>

(Don’t forget to create an index.html page in this folder.)

2 Installing mysql

Go to http://dev.mysql.com/downloads/mysql/5.0.html scroll down until the windows versions. You’ll see 3 versions available. The windows essentials version, the windows version and a version without an installer.

Choose the windows version. After downloading it install the mysql server. Use all the default values for less problems J.


3 Installing PHP

First of all download the windows version of PHP 5 from www.php.net/downloads.
Download the .exe and the .zip package.

Execute the exe version. If it asks you where to install choose c:\php. This is the best place to install php. When it is done IIS is completely configured to use PHP. The only thing you need to check now is if you wanne use index.php as a default page.
If so you need to add this to the documents.

Go to control panel in windows, choose administrative tools and choose Internet information server IIS.

Expand the tree and right click on the computer icon (your computer name). Choose properties and go to the tab documents. Press Add and type in index.php. Press OK and your ready.

Now lets install some extensions.
First of all unzip the zip version of PHP. Copy all the files to the c:\php folder. Or the folder you installed php to. Just overwrite all files. You will have a lot more dll’s and folders now. These are external extensions like mysql link, gd library, imap etc…
You can configure php now to use these extensions. Lets install GD library as an example.
Go to c:\windows and find php.ini. Open this one in notepad. Find the following line: extension_dir = "./". the “./� to “c:\php\ext\�.

This is the path to your extension folder where php_gd2.dll is located for example.
Now to active this php_gd2.dll find “Windows Extensions� in the php.ini file. You’ll get a list of extensions with a ; before it. This means it is not installed. Remove the ; from each extension you wanne install. In this case change

;extension=php_gd2.dll

to

extension=php_gd2.dll

Mysql: To get mysql work with php we need to do a few more steps. There is a special dll file that needs to be available for the system root. You can choose copying this file to the root or adding the path to the file in the windows path vars. The last solution is the best way to do this. The file we are talking about is libmysql.dll and is located under c:\php. So go to configuration panel, system, advanced tab and press the button Environment variables. In the lower list highlight the path and press edit.
DO NOT DELETE ANY CONTENT IN THIS LINE !!!. Just add ;c:\php\ to it. press OK and your done.


4 HTML-kit


Last but not least. We need an html editor. I like html-kit.
Go to http://www.chami.com/html-kit/ download the software and install it.

5 Other ways instead of my example:

useful for windows, Mac OS, Linux and Solaris

http://www.apachefriends.org/en/xampp.html

Some links to set up php on MAC OS:

http://developer.apple.com/internet/opensource/php.html
http://www.entropy.ch/software/macosx/php/
Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Sun, 2006-02-19 00:19.
I seriously doubt most people would consider this a sufficiently good quality HOWTO for this site. There is very little useful content, there is a serious need for spelling/grammar editing, and it's not even complete. Furthermore, it needs considerable reformatting to look respectable. I would also consider changing the multiple question/one-sentence answer organization. It's not a FAQ. Shouldn't this be removed until its up to par? I for one would be embarrassed to have posted a HOWTO of this quality level to this site. Isn't there anyone reviewing quality here?
Submitted by DenisV (registered user) on Mon, 2006-01-30 09:33.
Thanks, excellent work!

-----

T.Reader

Submitted by Anonymous (not registered) on Wed, 2005-12-14 17:41.

I also thought that this was a linux resource site. I can see this as value if you didn't know about Xamp for windows.


http://www.apachefriends.org/en

Submitted by Anonymous (not registered) on Sun, 2005-10-16 21:46.
Don't let me be misunderstood, but isn't this site about Linux's HowTos? Don't we have still enough troubles with Windows already? Why don't you write tutorial for installing Apache+PHP+MySQL on Linux and developing php sites on Linux? My experience told me that there are several functions that doesn't work under Windows and you might need them thru your developing process. TIA Ian
Submitted by Anonymous (not registered) on Thu, 2005-11-17 15:43.
Hi but I think this section is for PHP. Installing php on an apache server with mysql etc on linux is well explained in other tutorials. And becouse most webdesigners work on windows (or MAC) I'll use the windows way.

I added some links to how to install it on other systems like mac etc...
Submitted by f (not registered) on Wed, 2009-01-21 14:23.
thanx for your writing to post, I like your web site and good lucky. Regards.
Submitted by Anonymous (not registered) on Wed, 2005-10-12 07:34.

Hi,

everybody can write comments to this page on what they use on windows for developping php. My way is one way to do it but there are a lot of other possibility's.

for instance you could use Xitami as a webserver to.

Submitted by Anonymous (not registered) on Tue, 2005-10-11 20:54.

Sorry to be so harsh but why I this article to be considered a how-to anyway? - I mean, the first half is just introduction and the second half is plain "stick with the installation guide". Hello?

Submitted by Anonymous (not registered) on Thu, 2005-10-13 18:56.

Well it is becouse it is the first page of the howto. At this moment they created a book of my 2 pages I wrote and I hope I find time to fill in more pages about PHP.
This first one is indeed only a setup guide. And you can stick with the installation guide but it is simply my development machine. Some kind of info part about what i use for development. And there will be more parts in the future like this becouse this is only the verry basic setup.

greets.

Submitted by Anonymous (not registered) on Mon, 2005-10-10 12:50.
For Windows, I would still prefer to use packaged installers like XAMPP (http://www.apachefriends.org/en/xampp.html) or VertrigoServ (http://vertrigo.sourceforge.net/). Includes hassle-free install of Apache. It doesn't require a pro version, I think.