PHP MVC for an ASP.NET MVC developer part 1. Setting the stage.
April 22, 2012
Jacqie has a little LAMP!
What if the customer is hosting their sites on a LAMP server? Let’s write some PHP! This has a few advantages over IIS hosting. It is super affordable and available. However. Can I use the MVC pattern in PHP? Can I do OO in PHP? Can I have a layered architecture?
Searching DuckDuckGo for PHP MVC frameworks returns lots of results and it seems there are many PHP MVC Frameworks. See this list, for example. Now which one to choose? I want to be up speed as soon as possible. And that said, how to get that the PHP/MySQL stuff onto my Windows laptop?
Which PHP MVC Framework?
The PHP MVC framework I will use, should have a. enough documentation, b. support the latest and the greatest PHP version and c, be awesome. My winners are: CakePHP, Kohana (which is not that well documented and also pretty hard to use re the web but their website looks awesome) and YII.
Install the LAMP on Windows
To get a WAMP running, I picked the Uniform Server because it’s a small download and supports the latest PHP (5.4) and MySQL. It is also highly configurable and supports vHosts and stuff like that.
Download, extract and save it somewhere directly under the root of a drive. (D:)
Next, click Start_as_program.exe and start Apache and MySQL:
If that doesn’t work, just make sure you stop other webservers you might be running (run services.msc). The Uniform Server defaults to port 80.
When the services are started you see the default server displayed. The website live in the /www folder. Here you can put your php files.
And what’s so funny. Netbeans supports Git. Look at this:
Next time, you make coffee and I’ll be sure we have some CakePHP.