Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for IIS on windows.
Make sure you get the FastCGI extension for IIS 6.0 or IIS 7.0. It is the single most important thing you can have when running PHP under IIS. Also this article should get you setup:
http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/
Everything beyond this is simple, MySQL and what not.
We just rolled out PHP 5.2.6 + FastCGI on our shared hosting platform without any problems. As long as you follow the steps outlined in the article Nick linked to then you should be just fine.
My only additional piece of advice would be to forget about using the fcgiconfig.js script to modify the fcgiext.ini file, it's more of a hindrance than a help. Just edit it by hand, you also learn more about how it works.
If you're installing PHP onto IIS 7 then this link should be worth a read though:
Using FastCGI to Host PHP Applications on IIS 7
#pix0r
That actually annoyed the hell out of me too and nothing came close to Apache mod_rewrite. Because they all have this overly complex XML structure. So I actually took the time and wrote my own rewriter for IIS 6.0 and IIS 7.0. Non-.NET applications only works in IIS 7.0.
http://www.managedfusion.com/products/url-rewriter/
http://www.codeplex.com/urlrewriter
One of the major sticking points I've had with IIS is the lack of Apache's mod_rewrite. There are other work-arounds and work-alikes depending on what you're doing, but just keep in mind that you'll need to change things up a bit to work with IIS if you're using mod rewrite extensively.
Since you're moving from LAMP (a somewhat cool acronym) to WIMP (a less cool one), you may need to mentally affirm yourself. Otherwise, I've had very little trouble with PHP on Windows.
ISAPI rewrite (http://www.isapirewrite.com/) is $99 and has worked very well for me for URL rewriting.
Why not go with Apache on Windows?
If your using iis 7 keep an eye on this project, http://phpmanager.codeplex.com/.
Related
Any complete guide for setting/running PHP/MySQL on IIS 7.5?
Setting up MySQL should be pretty easy - run through the windows installer and it should be painless.
Setting up PHP correctly in IIS is another matter though. I found this guide to be extremely helpful.
You can use the web platform installer for PHP to get up and running quickly, but my experience has been that it falls seriously short, especially if you need to support multiple PHP versions or different php.ini settings for different sites.
A plugin to setup PHP in IIS: http://phpmanager.codeplex.com/
I am strictly a LAMP dev but an ad agency I work with is courting a government agency whose RFP requires that their site be delivered via a Windows server.
What advice do folks have on this? Are there specific pitfalls? It seems like I have heard that file uploads and folder permissions are very different on Windows servers.
Any advice would be greatly appreciated.
IME, IIS can behave very oddly at times.
The permissions model is primarily ACL based - so its certainly possible to design a system which mimics the way Unix works - but (just as with Unix) get the permissions model right - and don't tinker with permissions / ownership in your code.
And of course you'll get yourself tied in knots if you try to move up directory hierarchies and cross over 'drives'.
Add to that a complete absence of the services you might invoke via popen(), and the POSIX tools.
Yes, people keep telling me its a nice place to visit but I wouldn't want to live there.
OTOH, a self-contained set of PHP files will run quite happily there.
PHP on a windows server is definitely trying on your patience. Problems that I've run into are making sure that IIS is configured to use the correct php.ini file, and as you said, writing to files on the server as well as folder permissions.
That being said, if you can get it working correctly, it's not a bad production environment.
I would suggest getting your dev environment as similar as possible to what production will look like. That way you run into as few problems as possible when you deploy.
I can see some pitfalls for using PHP on IIS
Since IIS is multithreaded unlike
linux which is multiprocess. Some
PHP scripts might be unsafe.
Because of this PHP should be installed and
run as a CGI extension. CGI is
slower than IIS's ISAPI and worse
when compared to Apache's mod_php.
Another pitfall I can think of is URL rewriting. IIS, versions below
v7 do not support url rewriting.
Configuration of PHP with IIS is really a pain. But when you do configure it, make sure you use the same configuration, exact mirror images everywhere you are developing because a lot can go wrong with just one glitch.
I want to develop a professional website using PHP and MySQL. Can i do it in Windows 7 (64-bit) or i need to install linux based OS. How to go for it.
You can run an AMP Stack (Apache, mySQL, PHP) on Windows no problem. I have been doing this for ten years now. Running on Windows 7 64-bit is also no problem.
There are several pre-packaged installers available. My favourite is XAMPP. They usually allow full customization where needed.
You can also download the stand-alone binaries of each product and install them manually. Makes for very, very good learning but is more work.
Yes, you can.
Though a platform is the least thing you will need...
As mentioned it is possible to develop Php and MySQL sites quite happily on Windows using something like XAMPP, even if they are later to be deployed on a Linux web server and I know a lot of people do this and it works great for them.
However I have found in the past you can run into problems later on this way. For example, a lot of people who have only used Windows in the past can get caught out by case-sensitivity in Linux. So your site runs great locally but then you start getting lots of 404 errors when you go live because for example, mypage.php is not the same as myPage.php any more.
At the other end of the development spectrum, you can achieve some really powerful functionality when you start to work the server a bit more - things like video encoding or audio conversion are possible using PHP (with a bit of help from some other apps) on both Windows and Linux but the ways that you would do it are different therefore your development environment becomes much less useful and again you run the risk of putting something live that doesn't work, even tho it runs fine when you test it locally.
Personally, I think it is always best to develop on as close an environment to the intended production server as you can to avoid any nasty surprises when you go live.
Develop on the same platform you are going to be deploying to (if possible). It'll make it extremely easy to deploy with less room for possible error.
Installing the 64-bit versions Apache/PHP/MySQL on Windows 7 is a bit of a pain, but you can easily install the 32-bit versions using XAMPP (as mentioned by Pekka) from apachefriends.org
For Windows you can use a light package, which content php, apache, mysql, pear. link text
Here's the thing:
Due to a new project, I have to learn PHP from scratch. I'm now in windows and I DON'T want to change quickly, so, don't tell me to change.
I need to setup a DreamWeaverCS4/PHP5 develop environment, and, I don't have a clue whether to use Apache or IIS7.
I just need some advice relating to it.
Remarks:
I really don't care about performance(yet), neither portability, and so on. I just need to set it up quickly and easily.
Thanks in advance
UPDATE: I'm Using Windows 7 7600 x64
Setting up PHP on IIS is pretty simple. Here is what you need now...
http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/
Apache is the best as it's native for the PHP while IIS is foreign. You'll always get help for Apache+PHP here on SO and hardly for PHP+IIS.
I haven't used WAMP yet but I've never had a problem using XAMPP and it's a pretty easy install to get a complete php environment using apache. I wouldn't recommend going the IIS route, its possible but... not worth the effort.
Go and Download WAMP5 Server it is the best and easiest solution for u. By the way it is Apache.
I recommend Apache+PHP, which brings you mod rewrites, .htaccess and other important features that IIS does not support.
Apache-PHP is the better choice...
I want to test some PHP on my local machine running Windows XP Professional. I'm familiar with coding PHP for upload, but not with running a web server.
What is the easiest way to set up a test environment? Step-by-step instructions would be great if you can give them.
(I see WAMP recommended in this thread - thoughts?)
Update - a year later
A little self-promotion: after using XAMPP for a long time, I began to want things it didn't include. (Support for PDO was a big one - every time I tried to enable pdo and mysqli simultaneously, something crashed.) I eventually worked through the process of installing Apache, PHP, MySQL, and PHPMyAdmin individually, and documented the process with screen shots on my blog.
Some of the configuration that I was able to do this way could have been done in XAMPP, but it was only because I had to set things up myself that I discovered new things (like being able to serve files out of c:\whatever instead of c:\program files\apache\htdocs).
On the whole, I'm happier with having installed these items separately. But XAMPP was a good (and easy) package to start with, and served me well while I used it.
(source: apachefriends.org)
Xampp is the simplest. You can setup everything in a Step by Step and if you require further configuration (Virtual Server, extension) you have the normal php.ini and other file in the directory that you can edit yourself.
Here is the Step By Step installation for Windows.
XAMPP from ApacheFriends is pretty simple to set up and use.
note the site appears to be down as at 15:02 UTC on 3rd Dec 2008
note again and it is back!
Instead of WAMP, I recommend XAMPP, for Cross Platform (X), Apache, MySQL, PHP, and Perl, all in one package. It is very simple to setup and use, and like WAMP puts an icon in the system tray to manage it all.
You can get it here: www.apachefriends.org/en/xampp-windows.html. This site also includes comprehensive instructions to get up and running quickly.
There is even a portable version available at http://portableapps.com/apps/development/xampp.