PHP on IIS. Getting includes to parse PHP...
Moderator: General Moderators
PHP on IIS. Getting includes to parse PHP...
I don't have particulars right now, but I wanted to ask this question ASAP in hopes of getting an answer sooner than later. I can post particulars (IIS/NT/PHP versions, etc. tomorrow if needed). I know PHP is at least 4.x...
Is there any way to get IIS to execute .php files if they are added via an SSI include statement? Our setup is not doing this.
Here's the quick history. I took over a large intranet running on Netscape Enterprise on NT. No perl, no PHP, nothing but some kludgy javascript. I spent a lot of time at it but finally got PHP running under this system. Not wanting to rename and relink every page to .php extensions, I had (what I thought at the time) a brilliant idea. Using SSI, I could include PHP files even if the html file containing the SSI include was an .htm. I gave the includes .php extensions and IT WORKED! Oh joy! Rapture!
A month later, I find that IT hates NS Enterprise (says it crashes too often) and is switching over to IIS. It's my responsiblity to get PHP running, which I do (just yesterday). I see that php(info) works, but all my SSI-included .php's do not!
Is there any way to get this working? Is there something I missed? Is there any other alternative I can try that would allow me the .php's to run inside .htm's (and I don't think the IT staff would allow IIS to parse every file for php)?
Is there any way to get IIS to execute .php files if they are added via an SSI include statement? Our setup is not doing this.
Here's the quick history. I took over a large intranet running on Netscape Enterprise on NT. No perl, no PHP, nothing but some kludgy javascript. I spent a lot of time at it but finally got PHP running under this system. Not wanting to rename and relink every page to .php extensions, I had (what I thought at the time) a brilliant idea. Using SSI, I could include PHP files even if the html file containing the SSI include was an .htm. I gave the includes .php extensions and IT WORKED! Oh joy! Rapture!
A month later, I find that IT hates NS Enterprise (says it crashes too often) and is switching over to IIS. It's my responsiblity to get PHP running, which I do (just yesterday). I see that php(info) works, but all my SSI-included .php's do not!
Is there any way to get this working? Is there something I missed? Is there any other alternative I can try that would allow me the .php's to run inside .htm's (and I don't think the IT staff would allow IIS to parse every file for php)?
SSI's are running (we've already done your tip), but unlike under Netscape's server, .php's aren't processed in IIS's SSI's, the raw php code is just sent out to the rendered page, viewable in the source. Netscape would process all included php's before rendering the page, allowing for nested php's inside SSI includes.IIS is capable of SSI but by default it is enabled for .shtml and .shtm only.
If you add .htm it should work, too
I've never used exec before. I'll give it a try but first two questions...
Under NT, would the "path/to/php.exe" be the drive path (ie, starting with the drive letter)?
Following that path, is it possible/necessary to put the path/to/file.php or does the .php file need to go in a directory that's automatically searched by php for php files?
Under NT, would the "path/to/php.exe" be the drive path (ie, starting with the drive letter)?
Following that path, is it possible/necessary to put the path/to/file.php or does the .php file need to go in a directory that's automatically searched by php for php files?
I've never used SSI. But maybe these links are helpful:
http://www.4images.com/ntperl/isiall.htm
http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/WINDOWS2000/en/server/iis/htm/core/iisiwelc.htm
http://www.4images.com/ntperl/isiall.htm
http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/WINDOWS2000/en/server/iis/htm/core/iisiwelc.htm