Click to See Complete Forum and Search --> : NewBie


shanevdw
07-21-2006, 03:55 AM
Hi I'm new to PHP.
I would like to find out information on how to get started and what I need to set up for a testing environment at home and how you go about making everything live in the net.
Here are some questions:
What version of PHP do I install on my machine at home and where do I get it?
Do I need Apache installed on my machine?
If I install Apache will it conflict with IIS?
Where can I download Apache?
What database can I use? Can I use SQL Server 2000 and Express?
Can I only use MySQL?

As I said I am new to this and I haven't really got a clue on how to go about starting up. If someone could give me a crash course in this or give me a link where I could read up more about this topic would be greatly appreciated.

Thanks

ava
07-21-2006, 05:23 AM
Alright, that's a lot of questions. Basically to work with PHP, you need:
- PHP
- A Database Program
- A Webserver

PHP will allow you to make dynamic pages. You can download it from php.net and I recommend the latest version.

I'm not an expert on which database programs and webservers are compatible with PHP. I know that PHP/Apache/MySQL works though.

The webserver is the only program that can tell PHP to do something. To load a php-page, you have to call the webserver and call the page from there. Apache is a commonly used language and since it's from the same developer as PHP, it's an excellent choice. Go to apache.org to download the latest version. Having two webservers running at the same time is an invitation for trouble though. If you want IIS, don't install Apache (again, I don't know if it's compatible)

As for a database language, MySQL is cheap, reliable and works well with PHP. I don't know if the ones you mention do, but unless you already have those programs, I wouldn't bother with them and just install MySQL. You can find it at mysql.com

So, my suggestion of a ToDo list:
- Go to php.net and download php5
- Go to apache.org and download apache (version is not that important)
- Go to mysql.com and download mysql5
- Install MySQL and check if it works
- Install Apache and check if it works
- Install PHP and check if it works

The precise installation instructions vary a lot on your operating system, versions of the programs and some other things, so I'll leave that to you.

After you're done, there is a DocumentRoot variable in your Apache configuration file. Change it to the location you want your php-files in. Then, you can call them in your webbrowser by replacing your DocumentRoot with http://localhost/

For example:
- The DocumentRoot is c:\program files\apache group\apache2\web\
- You change it to c:\mysite\
- You place a file test.php in c:\mysite\
- You open Internet Explorer
- You type http://localhost/test.php

I hope this was helpfull.

shanevdw
07-21-2006, 05:47 AM
thanks so much I will give this a bash this weekend.

LiLcRaZyFuZzY
07-21-2006, 05:59 AM
Also, get the manual http://php.net/docs
or read it online: http://php.net/manual

you'll get a lot of infos there as well as an index of all available functions
every php developer has the manual in his pocket ;)

shanevdw
07-21-2006, 06:26 AM
thanks will check it out

scaiferw
07-21-2006, 09:06 AM
IIS also works fine as a webserver for development, and since it's built into most if not all versions of Windows you shouldn't have to much trouble setting it up (control panel, add/remove programs, add windows components).

Also, when I set up a development environment to parallel my webhost server, I was careful to keep my database schema, account names, passwords, permissions etc. identical on my home server (actually my regular PC) and on the webhost. This way my connect strings are identical and I can easily develop/update/test code on my machine at home and simply drop them on the server where the code runs as is.

MySQL works fine with Windows/IIS, and is a good and free way to get started with databases. The skills and code you develop with MySQL will be very portable.

By the way, since you're just getting started, here's a tip that may save you a lot of grief. Windows doesn't worry about uppercase or lowercase in paths, but Unix and Linux do, so treat all code and name your files as if it does even if you're only working on Windows. Some or all of your code is going to wind up running on some flavour of Unix/Linux some day, so if you do this from the start you'll save yourself a lot of aggravation.

To get everything up on the net, try the free account at www.awardspace.com - one of the few that offer free php and mysql support with out advertising banners on your sites.

If you don't have an FTP program there are good free ones out there, or most webhosts will provide a means to upload your code with a web browser.

Enjoy,

Rob

bokeh
07-21-2006, 09:38 AM
What version of PHP do I install on my machine at home and where do I get it?
Always use the same version as your live environment.
Do I need Apache installed on my machine?
If you want a webserver that works properly, yes.
If I install Apache will it conflict with IIS?
Yes if they are both configured on the same port, otherwise no.
Where can I download Apache?
www.apache.org
What database can I use? Can I use SQL Server 2000 and Express?
Always use the same version as your live environment.
Can I only use MySQL?
Always use the same version as your live environment.

shanevdw
07-24-2006, 12:29 AM
Thanks guys much appreciated

NogDog
07-24-2006, 01:20 AM
If you want to install everything on your PC to work with locally, I recommend you look into downloading and installing XAMPP (http://www.apachefriends.org/en/xampp.html) instead of trying to install all the pieces separately. (It installs Apache, PHP, Perl, and MySQL.)