views:

218

answers:

13

I am starting on a project where I will be making HTML and CSS edits to PHP site. I need to configure my home computer to run the site and do PHP development work on it.

What is the best recommendation for a beginner to start PHP development? I have an extensive background using the Microsoft programming stack and .NET development.

My home computer is currently using Windows Vista Home Premium x64.

A: 

Wampserver has Apache, MySQL, PHP to kickstart your development on Windows. Another good WAMP environment is Zend Sever CE, which has the added bonus of Zend Profiler to profile your pages. As for IDE, I would recommend Zend Studio or it's free variant (albeit less features) Eclipse with PDT.

jusunlee
NuSphere PhpED is also a worthy IDE (not free though)
Marek Karbarz
A: 

download this http://www.wampserver.com/en/. It's pretty much automatic and you'll have a webserver up in seconds.

Galen
+6  A: 

For a webserver i highly recommend WAMP if you're on windows. Use lamp if you are on linux.

Good online resources are the W3 tutorials aswell as the all mighty php.net manual.

alexn
A: 

You need a WAMP. Windows, Apache, MySQL, PHP. You can use different servers and database managers, but thats the common setup.

Gastoni
+2  A: 

Checkout XAMPP: http://www.apachefriends.org/en/xampp-windows.html

But you'll want to match your PHP and DB versions with your live server.

Scott Saunders
here is a link to older releaseshttp://sourceforge.net/projects/xampp/files/ . You'll need it if your live server is not the same versions of PHP and MYSQL as the latest release - which is PHP 5.3.0 and MYSQL 5.1.37
Mark
I don't like the idea of using this bundles. I recognize their ease of use, but as a developer I think that is important to understand which are the pieces that make the web server work so you can quickly troubleshoot problems or change the version or the brand of one of the pieces.
Gastoni
@Gastoni: If you want to be able to switch versions, use WampServer: it allows you to switch between different versions of PHP, MySQL and Apache. Let's face it: there's a good chance you won't have to do the setup when you get to your final host so although I agree with you in principle, I just think there's more value in getting to the development itself...
Narcissus
A: 
  • Download XAMPP and install it (trivial)
  • Change Apache port in case you are using IIS to something like 8080
  • Go to (install dir of xampp)\htdocs create a new folder ("mydir"), then create an index.php and write in it
  • Navigate to http://localhost:8080/mydir

You should see your PHP file. Now all is set up: just start your PHP development :)

Palantir
A: 

I would use wamp from http://www.wampserver.com/en/

Its super easy to use and install.

codedude
A: 

You can also try Microsoft Web Platform. It will automatically install/configure all necessary things you need to run PHP applications.

Marek Karbarz
+1  A: 

Everyone here seems to already have 'their own favorite packaged wamp' recommendation ready to go. I'll be different and recommend you setup your development environment as closely as you can to production. You phrased your question in a way where it seems safe to assume the site already exists in production somewhere, so to follow any of these other recommendations because it's easy would be foolish. If you were starting from scratch it would be another story.

You don't want to be quick and dirty when it comes to something like this. Matching environments as closely as you can will eliminate a TON of potential issues down the road. Especially if you're developing on windows then pushing out to linux. Unless you're extremely careful with your casing 100% of the time you're probably going to run into problems.

That's really all you need.

Mike B
Matching sounds good in theory but the match is never perfect and deciding which parts can be different comes with experience. XAMPP makes no system-wide changes and can be removed easily when he's ready to make an environment that matches better.
Rob Russell
@Rob are you suggesting he setup something as quickly as possible without understanding all the moving parts with no respect to the production environment just so he can uninstall it later once he finds out that some seemingly insignificant incompatibility will cost him an extra week or two of development time?
Mike B
@Mike. "matching the production environment" is nice in theory, but in practice, he may not even have access to all the information needed to really duplicate the production environment, and since he is a beginner with the amp stack, there is precious little chance that he would manage to duplicate it even if he had access to those data. So, either way, he will not have the same environment. All in all, he will probably be better off just setting up WAMP with the same major versions as the production server and replicate as many of the settings as possible. It will work just fine.
Sylverdrag
@Sylverdrag Again, so you're advocating starting production on a stack you don't understand and spending time trying to emulate environments is probably a waste of time. You're making a ton of assumptions without knowing ANYTHING about the following: size and complexity of the site, technologies used, version numbers, frameworks, extensions/plugins, and an unknown number of other factors. My main point is that the author asked an extremely broad question with very few details, and my answer, imho, is the only one here who respects the infinite number of combinations with best-practice advice.
Mike B
Sylverdrag
@Sylverdrag Except he is not simply making html and css edits. If that were the case he wouldn't need lamp at all. He stated in a very generalized question that he was setting up a development environment to work on a pre-existing site. Our disagreement seems to stem from different learning styles. You seem to advocate for shoot first and learn from your mistakes later, whereas I am only trying to provide a word of caution to a former .NET developer. That is that *AMP environments are very different beasts from site to site and that should be respected.
Mike B
Another reason I may have *assumed* he wasn't some script kiddie firing up his first hello world script for the first time is his comment about extensive experience with .NET. He obviously knows what he is doing and, one would think, a mature developer would appreciate advice about *hidden* fundamental differences between .NET and *AMP. PHP already has a bad enough reputation for this kind of behavior.
Mike B
@Sylverdrag Can we agree to disagree and say that Wamp/Xampp is the quickest and easiest way to get going with PHP development just be aware of the pitfalls involved with different environments? :p
Mike B
+1  A: 

You can run PHP sites under IIS or Apache

If you already have IIS installed then you can run PHP with it - just google running PHP under IIS for more information.

If you want to go down the route of running it under Apache then here is a good straightforward guide to installing everything - it takes you through the whole set up process. http://www.bicubica.com/apache-php-mysql/index.php

I would recommend trying to match your development environment as closely as possible to what the live one is going to be/or already is if the site is already live - it will save lots of hassle down the line.

I would recommend Eclipse as a free IDE. It doesn't come with a debugger however so you might want to look at Zend or XDebug.

If you are only going to be making HTML/CSS changes, you might not want to bother with Eclipse, just use your favorite editor.

W3Schools PHP section is great to help you get started getting to grips with PHP

carok
A: 
  • download and install VMware Server

  • download and install CentOS as a virtual machine

  • yum install apache2 php5 mysql-server

  • configure your local webserver to match your production machine

  • image your base virtual machine

  • setup ssh access to your virtual machine

  • install git on your vm and your workstation

  • install xdebug and configure php.ini

simplemotives
A: 

I'd go with Bitnami's. I've tried the others and this one gives the least amount of problems settings up

http://bitnami.org/stack/wampstack

A: 

I'm a Xampp fan, but I didn't write to tell you what everybody else already said. I'm here to talk IDE.

I was using Easy Eclipse or Eclipse PDT, but found it hard to set up and less that friendly. Then a friend (serious pro coder guru) told me about NetBeans. NetBeans is a lot like Eclipse, but I have found it to be a lot more forgiving and easier to use. It easily sets up FTP access, which is great for testing on a remote server. It also supports SVN and other versioning software. It's been very useful to me and I hardly use anything else to code anymore. Oh, and it's free. I highly recommend it.

I almost forgot - you can connect NetBeans to your MySQL server and set up tables and fields using the NetBeans database tools. You can also use the tool to help you build queries using the names of various defined database components - no typos when the system fills in the names for you.

Frank DeRosa