Author Topic: Q&A 2010: IIS and PHP  (Read 3984 times)

0 Members and 1 Guest are viewing this topic.

Offline subtalkTopic starter

  • Microsoft Q&A
  • Irregular
  • Posts: 7
  • Gender: Male
  • Facilitator
    • View Profile
Q&A 2010: IIS and PHP
« on: February 22, 2010, 11:32:16 AM »
Dedicated discussion space for the following questions:

Quote
Can the following features be implemented in IIS?
  • A native rewriting engine (similar to mod_rewrite)?
  • A text based configuration facility
  • .htaccess files?

How easy would it be to port a custom application (written in PHP with Apache/MySQL) from Apache (port 8080) to IIS (with default settings)? What are the dangers of this?
What php extentions are enabled when IIS is installed?
Will IIS run on all Window's home (Vista/XP/Windows7)?

Offline Pierre Joye

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #1 on: February 22, 2010, 12:08:12 PM »
Quote
A native rewriting engine (similar to mod_rewrite)?

There is no plan for an IIS 100% compatible with mod_rewrite. However you can import them using the import tools in the IIS manager, see http://technet.microsoft.com/en-us/library/ee215184(WS.10).aspx.

You can also use a commercial tool available here http://www.micronovae.com/ModRewrite/ModRewrite.html, which is fully compatible with mod_rewrite (never tested it but heard good thing about it.

Quote
A text based configuration facility

To be used instead of the XML format? There is no plan for that either. However an improved UI for the IIS manager is planed, especially for the php/fcgi part.

Quote
.htaccess files?

There are two solutions:








Offline steviewdr

  • Guru
  • Addict
  • *
  • Posts: 1,650
    • View Profile
    • http://sburke.eu
Re: Q&A 2010: IIS and PHP
« Reply #2 on: February 22, 2010, 12:13:25 PM »
Excellent information. I did not know about .user.ini files in php5.3.

Regarding .htaccess files: another common use for them is to allow a user to quickly limit access to a folder and/or to have auth.
Can this be done, or does it require the IIS Manager?

Thanks,
Steve

Offline Kris

  • Staff Alumni
  • Fanatic
  • *
  • Posts: 4,240
  • Gender: Female
  • PHP 5.3 | MySQL 5.1 | Apache 2.2 | Ubuntu 10.10
    • View Profile
    • Flingbits
Re: Q&A 2010: IIS and PHP
« Reply #3 on: February 22, 2010, 12:19:58 PM »
Quote
A native rewriting engine (similar to mod_rewrite)?

There is no plan for an IIS 100% compatible with mod_rewrite. However you can import them using the import tools in the IIS manager, see http://technet.microsoft.com/en-us/library/ee215184(WS.10).aspx.

You can also use a commercial tool available here http://www.micronovae.com/ModRewrite/ModRewrite.html, which is fully compatible with mod_rewrite (never tested it but heard good thing about it.

I appreciate that you don't have a "version" of mod_rewrite specifically, but from what I understand you do have a URL Rewrite Engine of your own available for IIS 7 to which rules written specifically for Apaches mod_rewrite can be imported into using the technique you have linked to above - Have I understood this correctly?

Offline Pierre Joye

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #4 on: February 22, 2010, 12:22:11 PM »
I appreciate that you don't have a "version" of mod_rewrite specifically, but from what I understand you do have a URL Rewrite Engine of your own available for IIS 7 to which rules written specifically for Apaches mod_rewrite can be imported into using the technique you have linked to above - Have I understood this correctly?

Yes, this tool can import apache's rules.

Offline wcoleman

  • Microsoft Q&A
  • Irregular
  • Posts: 4
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #5 on: February 22, 2010, 12:38:12 PM »
Just to let you guys know, IIS 7 does have a URL rewriting module called funnily enough 'URL Rewrite' - http://www.iis.net/expand/URLRewrite

Here's a brief description: "URL Rewriter for IIS 7.0 enables Web administrators to create powerful rules to implement URLs that are easier for users to remember and easier for search engines to find. By using rule templates, rewrite maps and other functionality integrated into IIS Manager, administrators can easily set up rules to define URL rewriting behavior based on HTTP headers and server variables, or to perform redirects, send custom responses, or stop HTTP requests based on the logic expressed in the rewrite rules."

Offline GarrettSerack

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #6 on: February 22, 2010, 12:38:32 PM »
Quote
Will IIS run on all Window's home (Vista/XP/Windows7)?

IIS isn't supported on Windows XP Home, but it is on Windows 7 Home Premium, Home Basic, or Home Starter  (http://technet.microsoft.com/en-us/library/cc731911.aspx)

G

Offline Pierre Joye

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #7 on: February 22, 2010, 12:38:54 PM »
Quote
Can Virtual Sites have different php.ini configurations?
Can multiple versions of php be run together on Virtual Sites?

Besides the solutions described earlier, you can run multiple PHP version (and each with a different php.ini). See http://blogs.iis.net/ruslany/archive/2009/12/16/multiple-php-versions-on-the-same-iis-server.aspx for a tutorial.

Offline Kris

  • Staff Alumni
  • Fanatic
  • *
  • Posts: 4,240
  • Gender: Female
  • PHP 5.3 | MySQL 5.1 | Apache 2.2 | Ubuntu 10.10
    • View Profile
    • Flingbits
Re: Q&A 2010: IIS and PHP
« Reply #8 on: February 22, 2010, 12:41:55 PM »
Quote
Will IIS run on all Window's home (Vista/XP/Windows7)?

IIS isn't supported on Windows XP Home, but it is on Windows 7 Home Premium, Home Basic, or Home Starter  (http://technet.microsoft.com/en-us/library/cc731911.aspx)

G

I would assume that due to these environments not being suitable for production use, that there are some built-in restrictions, such as a low number of concurrent connections, etc?

Offline cags

  • Guru
  • Fanatic
  • *
  • Posts: 3,250
  • Gender: Male
    • View Profile
    • TiB Studios
Re: Q&A 2010: IIS and PHP
« Reply #9 on: February 22, 2010, 12:43:43 PM »
I'm relatively new to web development as a whole, only having started to look at it back in September last year, so bare with me if my question/s seem uninformed.

From what I'm understanding here, a custom Rewrite Engine has been written for use with IIS and that there is also a tool available to convert mod_rewrite rules to the standard used by this Rewrite Engine. With this being the case, what was the reason behind developing a custom Rewrite Engine as opposed to a 'port' of mod_rewrite. It seems like twice as much effort to implement a new system and  a conversion/translator tool to convert the Rewrite Rules, as it would have been to use a similar/ the same syntax. Was there some underlying advantage in performance/adaptability in writing a custom system, or perhaps some legal issue with essentially recreating mod_rewrite. Since Apache is undeniably the current de facto standard, it seems odd to expect people to learn a new system / rely on a translation system, if it was possible to simply implement something they are currently used to.

Also I'm not sure it was explicitly asked or addressed, but is there support for per directory changes of other environmental settings, such as access rights, error documents etc which people are so used to using with Apache.
CodeCanyon - Cheap, High Quality, Ready Made Scripts.

Offline Pierre Joye

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #10 on: February 22, 2010, 12:52:58 PM »
Yes, see the other replies in this thread. Custom error page, rewrite migration, configuration per directory, etc. have been covered.

Offline GarrettSerack

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #11 on: February 22, 2010, 12:53:07 PM »
I would assume that due to these environments not being suitable for production use, that there are some built-in restrictions, such as a low number of concurrent connections, etc?

I know there used to be some limits in XP, but I'm pretty sure they aren't there in Windows 7. (I know that you can run multiple web servers on multiple ports now, unlike before).

I believe that post Vista-SP2 connection limits are gone completely: http://deepxw.blogspot.com/2009/05/say-bye-to-half-open-tcp-connections.html

G

Offline Pierre Joye

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #12 on: February 22, 2010, 01:13:17 PM »
Quote
What php extentions are enabled when IIS is installed?

Every available extensions are available on Windows, be with IIS (NTS) or Apache (Thread safe). The VC9 versions of our binaries have more extensions available and more features as well (like SSH support in CURL, or GMP).

Offline GarrettSerack

  • Irregular
  • Posts: 9
    • View Profile
Re: Q&A 2010: IIS and PHP
« Reply #13 on: March 02, 2010, 06:43:14 PM »
Quote
How easy would it be to port a custom application (written in PHP with Apache/MySQL) from Apache (port 8080) to IIS (with default settings)? What are the dangers of this?
It shouldn't be very difficult. If you depend on .htaccess files you'll need to import the settings into IIS using the IIS configuration tool. Outside of that, PHP executes the same as it does under Apache--except that you don't need the thread-safe version, you can use the faster non-thread-safe version of PHP.

Offline cags

  • Guru
  • Fanatic
  • *
  • Posts: 3,250
  • Gender: Male
    • View Profile
    • TiB Studios
Re: Q&A 2010: IIS and PHP
« Reply #14 on: March 04, 2010, 06:26:28 AM »
I'm not sure if the experts are still monitoring these threads, but I figured I'd ask just in-case. I was recently chatting to somebody in our IRC help channel who had tried to move their site from a Linux Apache server to a Windows IIS server. Upon copying the scripts over though they received a 500 error code every time they hit a page. Being unfamiliar with IIS I wasn't sure what to suggest to diagnose this, I assume IIS generates a log file, but I believe the person was on shared hosting and may not have access to such logs anyway.

The person I was chatting to believed they had narrowed the error down to a line of code which was simply..

Code: [Select]
include("somefile.php");
I personally couldn't understand why this should perform differently across different server technologies. Are there any known issues regarding this?
CodeCanyon - Cheap, High Quality, Ready Made Scripts.