RE: [PHP] Installing under IIS6.0
[snip] However, this really isn't what I'm looking for. I'm simply looking for a way to parse PHP code from within existing HTML pages, so that I can migrate a site from Apache to IIS6.0. Like I said, if I were using Apache, I would just add .html to my AddType directive, and call it good. Is it not this simple under IIS? [/snip] Sorry, I just saw this thread. In order to handle HTML you have to allow it to be handled via the ISAPI dll Open Internet Information Services, right click on the web site, click Properties. On the Home Directory tab make sure Execute Permissions is set to Scripts Only. Click the Configuration button just to the right of that. Click Add. In the Executable box put the path to yous PHP ISAPI dll In the Extension box put .html Click OK until you get back to the IIS main. Stop the web server, then restart. HTML files will now be handled through the PHP dll. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Installing under IIS6.0
Jay Blanchard wrote: [snip] However, this really isn't what I'm looking for. I'm simply looking for a way to parse PHP code from within existing HTML pages, so that I can migrate a site from Apache to IIS6.0. Like I said, if I were using Apache, I would just add .html to my AddType directive, and call it good. Is it not this simple under IIS? [/snip] Sorry, I just saw this thread. In order to handle HTML you have to allow it to be handled via the ISAPI dll Open Internet Information Services, right click on the web site, click Properties. On the Home Directory tab make sure Execute Permissions is set to Scripts Only. Click the Configuration button just to the right of that. Click Add. In the Executable box put the path to yous PHP ISAPI dll In the Extension box put .html Click OK until you get back to the IIS main. Stop the web server, then restart. HTML files will now be handled through the PHP dll. Thanks for the response, Jay - Some trial and error led me to do just this, which works fine. The reason why I'm doing this, is because I'm trying to get someone to convert from using PHP embedded inside HTML pages, to making straight PHP pages ending with .php, so that only PHP will snag those. For right now I'm satisfied with a resource sacrafice to make this transition work. Thanks again -dant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Installing under IIS6.0
Hello, all - This is a subject that I've seen pop up on the list a few times, but not in great detail about setting up PHP under IIS 6.0. What I'm trying to achieve here is to install PHP to process PHP code embedded inside of HTML pages. Under Apache, I'd just add .html to my AddType directive and call it good. I know I'd sacrafice some speed for a bit of functionality (and bad code), but that's a sacrafice that I need to make here. I've got PHP set up to the point where it will process files ending in .php, but I want to blanket the processing of PHP code under IIS in the same manner in which I blanket PHP code with Apache. If anyone has any suggestions, other than reading PHP's manual which I've read several times which does not cover this, I would greatly appreciate it. Thanks -dant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Installing under IIS6.0
I've got PHP set up to the point where it will process files ending in .php, but I want to blanket the processing of PHP code under IIS in the same manner in which I blanket PHP code with Apache. If anyone has any suggestions, other than reading PHP's manual which I've read several times which does not cover this, I would greatly appreciate it. I wrote a little 'hack' to mimic modrewrite for IIS. When you get a 404 error page in IIS, you get the URL of the originally requested page in the $_SERVER['QUERY_STRING'] variable. So by creating a custom 404 error page with this knowledge you can mimic the basic functionality of modrewrite: ?php /* Simple PHP script that imitates mod_rewrite for IIS 6.0 Set this script to be your 404 error document in the folder where you want mod_rewrite to be enabled Your rule can contain regular expressions in the Perl 5 syntax (PCRE). You can use references in your target ($1, $2, etc) to refer back to parts of your rule. */ $rule = /(.*?)\/content\/([a-zA-Z0-9]+)\/([0-9]+)/m; // Original URL that is typed in the browser $target = /oilpowered.com/index.php?type=$2id=$3; // Redirect to the new URL. Only relative URLs! $qs = $_SERVER['QUERY_STRING']; $url = substr( $qs, strpos( $qs, ; )+1 ); // TODO: $page - preg_replace() in the if clause, to save one regexp? if( preg_match( $rule, $url ) 0 ) { $page = preg_replace( $rule, $target, $url ); header( Referer: . $_SERVER['HTTP_REFERER'] ); header( Location: . $page ); } ? Hope this helps, Tjoek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Installing under IIS6.0
On Sep 19, 2005, at 9:45 PM, Dan Trainor wrote: Tjoekbezoer van Damme wrote: I've got PHP set up to the point where it will process files ending in .php, but I want to blanket the processing of PHP code under IIS in the same manner in which I blanket PHP code with Apache. If anyone has any suggestions, other than reading PHP's manual which I've read several times which does not cover this, I would greatly appreciate it. I wrote a little 'hack' to mimic modrewrite for IIS. When you get a 404 error page in IIS, you get the URL of the originally requested page in the $_SERVER['QUERY_STRING'] variable. So by creating a custom 404 error page with this knowledge you can mimic the basic functionality of modrewrite: ?php /* Simple PHP script that imitates mod_rewrite for IIS 6.0 Set this script to be your 404 error document in the folder where you want mod_rewrite to be enabled Your rule can contain regular expressions in the Perl 5 syntax (PCRE). You can use references in your target ($1, $2, etc) to refer back to parts of your rule. */ $rule = /(.*?)\/content\/([a-zA-Z0-9]+)\/([0-9]+)/m; // Original URL that is typed in the browser $target = /oilpowered.com/index.php?type=$2id=$3; // Redirect to the new URL. Only relative URLs! $qs = $_SERVER['QUERY_STRING']; $url = substr( $qs, strpos( $qs, ; )+1 ); // TODO: $page - preg_replace() in the if clause, to save one regexp? if( preg_match( $rule, $url ) 0 ) { $page = preg_replace( $rule, $target, $url ); header( Referer: . $_SERVER['HTTP_REFERER'] ); header( Location: . $page ); } ? Hope this helps, Tjoek Hello, and thanks for the reply, Tjoek - However, this really isn't what I'm looking for. I'm simply looking for a way to parse PHP code from within existing HTML pages, so that I can migrate a site from Apache to IIS6.0. Like I said, if I were using Apache, I would just add .html to my AddType directive, and call it good. Is it not this simple under IIS? Thanks -dant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Don't fear the Google, Dan ;-) http://www.neowin.net/forum/index.php?showtopic=369437 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php