Partner and Community Forums
PHP site on IIS
Last post Nov 20, 2013 03:07 PM by LAMPProgrammer
Nov 03, 2013 06:05 PM|jats_ptl|LINK
I have a PHP Site that is running fine as intranet site on Apache. It has a huge database using mySql.
Now I have a requirement to move this site to IIS7.
So the question is What are the possible changes I have to take care of to make my site work on IIS.
Your help is much appreciated.
Nov 04, 2013 12:31 AM|HostingASPNet|LINK
You should care for:
1. The database connection string could be different depending on your configuration.
2. The URL rewrite (if you have any) should be changed to be via the IIS URL rewrite module.
Nov 04, 2013 09:13 PM|jats_ptl|LINK
Thanks for your reply.
Apart form installing PHP. What else I need to install?
Nov 20, 2013 03:07 PM|LAMPProgrammer|LINK
You can probably expect to have to create one or more "web.config" files in the site's root directory and/or subdirectories, particularly if the site us using any sort of custom error handling (which is more common than you'd think these days).
This is because Apache uses an ".htaccess" file that resides in the site's root directory that IIS doesn't read or make any use of.
So you'll have to read the .htaccess file(s) being used by your site (if at all), figure out what its doing, and create an equivalent "web.config" file that effectively does the same thing. Alternatively, you could just manually change the settings in IIS
to mimick the same behavior, but I'd recommend the "web.config" approach personally just for the sake of being consistent. Plus if you're using something common, like WordPress, chances are you might be able to find a web.config file already readymade that
has already been confirmed to work, so you won't have to do any manual editing yourself at all.