Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php on iis

Status
Not open for further replies.

dinger2121

Programmer
Sep 11, 2007
439
US
Hello,
I have an ASP web site, but would like to include a php script within a page. can this be done?

Thanks
 
an asp page. What do I have to do within IIS to allow a PHP script to be executed?
 
You need to tell IIS to parse the pages that end in .asp through the PHP interpreter.


PHP Online Manual said:
Windows and PWS/IIS 3

The recommended method for configuring these servers is to use the REG file included with the distribution (pws-php4cgi.reg in the SAPI folder for PHP 4, or pws-php5cgi.reg in the main folder for PHP 5). You may want to edit this file and make sure the extensions and PHP install directories match your configuration. Or you can follow the steps below to do it manually.
Warning

These steps involve working directly with the Windows registry. One error here can leave your system in an unstable state. We highly recommend that you back up your registry first. The PHP Development team will not be held responsible if you damage your registry.

* Run Regedit.
* Navigate to: HKEY_LOCAL_MACHINE /System /CurrentControlSet /Services /W3Svc /Parameters /ScriptMap.
* On the edit menu select: New->String Value.
* Type in the extension you wish to use for your php scripts. For example .php [green]In your case this would be .asp[/green]
* Double click on the new string value and enter the path to php.exe in the value data field. ex: C:\php\php.exe "%s" %s for PHP 4, or C:\php\php-cgi.exe "%s" %s for PHP 5.
* Repeat these steps for each extension you wish to associate with PHP scripts.
This however will make every single asp page you have be sent through the PHP interpreter regardless of whether or not there is any PHP code present in the page.

If you have many ASP pages and they have lots of code involved can slow down the server noticeably.


With that said, I'm not entirely sure why you would want to do this, normally server side languages are not mixed, because what you can do with one, you can do with the other.

What is it you need to do in PHP that would require this? And couldn't you accomplish the same thing using ASP?


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I could mimic what the php code in asp, but since it was already built in php at a sister site, I thought I might just be able to utilize the php code.
I have since determined that it will be ultimately better for me to rewrite it in asp, so that is the route I am taking.
Thanks
 
Ah Yes, I imagined as much.

You can try the configuration and judge by yourself, if the server slows down or not enough for you to remove it. Or if recreating the functionality is worth it compared to the performance impact on the server.

If you decide to remove the functionality, you can just reverse the steps above and be done with it.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top