How to parse .php to .html

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

How to parse .php to .html

Post by HS0018 »

I've done research on how to parse php code into html and found it by creating .htaccess with the following code:

Action php-script /interpreters/php-script
AddHandler php-script .php .php4 .php3 .html .htm

Therefore, I created (copy and paste the .htaccess) .htaccess at the wwwroot directory but still not working.

Does anyone has suggestion? Thank you
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

wwwroot ? IIS ?
.htaccess is Apache specific.
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

Post by HS0018 »

I don't have apache installed on our Windows NT. Is there a way for me to parse php to html? I'm desperately stuck opening the .php file with password prompt. I can get in just fine internally with http://hostname/file.php just fine.

But if I go to http://www.hostname.com/file.php, I get password prompt & 401.3 ACL error. I set IUSR_machine name to read php.ini,wwwroot,c:/php directory. The funny thing is that I get CGI error if I give IUSR an execute permission for php-cgi.exe. Windows NT is way too strict! :(

I'm trying to work around it by parsing the php code to html, but still couldn't get it to work. If you can help me, I greatly appreciated. Desperate for solution here. :(
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

check your permissions on the web folder itself. If you can hit it internally, it might be using your NT domain account to access the files.

just make sure the IUSR has read permissions on the folder.

also make sure that anonymous access is checked in the directory security in IIS.
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

Post by HS0018 »

Thank you again Burrito for your valuable input. FYI, I got the php dynamic content to work using the php variable. I got this idea from your input. Thank you for that

PHP folder:
IUSR_machine (RX) (R) 1. Directory 2. File access
IWAM_machine (RX) (RX)
Administrator (ALL)
IP_Browsers (RX) (RX)
System Full Control (All)

PHP-CGI.EXE
IUSR_machine (R) 1. Directory 2. File access
IWAM_machine (RX)
Administrator (ALL)
IP_Browsers (RX)
System Full Control (All)

PHP.INI
IUSR_machine (RX)
Administrator (ALL)
Everyone (RX)
IP_Browsers (RX) (RX)
System Full Control (All)

I checked the directory setting and the anynomous checkbox is checked. Still not working. :(

Nonetheless, thank you so much for your input
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

the web folder is what I was suggesting you need to check permissions on:

ie wwwroot and/or it's subdirectories
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

Post by HS0018 »

C:\inetPub\wwwroot where the php files reside

Admin (All)
Authors (all)
browser (RX) (R)
Administrator (all)
IUSR_machinename (RX) (R)
IWAM_machinename (RX) (R)
System (all)

other pages such as the html, htm can open just fine. Only .php that would not work. Thank you
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

weird...can't say I've ever experienced that.

you might try changing from cgi to isapi (assuming your using cgi currently).

isapi is much better (faster) anyway.
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

Post by HS0018 »

I will try to do that with manual installation. thanks
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

Post by HS0018 »

One thing that I noticed was that it doesn't give me a CGI error when I give IUSR execute permission for the php folder. Other than that, it still prompt for a password.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

What he is saying is to give the IUSR_<yourmachine> user read/exe permissions on all your php files. This is the annonymous internet user account for NT (just like the user nobody on Linux). And you definitely want to run IIS with ISAPI, unless you are using NT 4.0.
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

Post by HS0018 »

Thank you for your input, Pyrite.

All the php files is under the wwwroot directory and inherit all the permission from this parent directory. I did verified the .php files as well and IUSR_<machine> had the read permission.

Thanks.
HS0018
Forum Newbie
Posts: 23
Joined: Thu Jun 02, 2005 2:39 pm

Post by HS0018 »

OK guys, I think it is more than just permission problem. It could be IIS and SSL issue here. We do have SSL certification in place.

The reason that I think that it could be the problem is that I can't even open .asp, .cfm, or .shtml without getting username and password prompt.

If you have any suggestion, I would greatly appreciate it
Post Reply