Forum Moderators: coopster

Message Too Old, No Replies

I am not able to open .php , .php3 files

but able to open .html files with php script

         

AjiNIMC

11:59 am on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

When I run localhost/info.html with the code

<?
phpinfp();
?>

This is running perfect but when I do the same with localhost/info.php or /info.php3 , it says the file is not found. I have checked all the possible mistakes. My apache config file has these lines

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .html
Action application/x-httpd-php "/php/php.exe"

Where am I making a mistake?

Thanks
Aji

jamesa

12:30 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try replacing these:

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .html

with this:

AddType application/x-httpd-php .php .php3 .html

and see if that makes a difference.

AjiNIMC

1:14 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tried that too, but it is not working. I am really bugged.

Aji

mykel79

1:29 pm on Mar 15, 2004 (gmt 0)

10+ Year Member



How about if you put the extensions in a different order? Does it still work the same way? Not that this is a way to solve the problem, but analyzing it might help determine the cause.

AjiNIMC

2:06 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tried all combinations but nothing works, I think there is some settings, which I am missing.

The strangest part is .html is working fine.

Aji

AjiNIMC

2:09 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



BTW I am using,

Apache/1.3.19 Server and PHP Version 4.3.4 , this might help in analysis.

Thanks
Aji

coopster

2:55 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



OK, you have an info.html file, but you do you actually have files with those other named extensions in the directory as well?

info.php
info.php3

I'm assuming the phpinfp was a typo in the first post...

jamesa

3:42 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yea, if the error is along the lines of "file not found" then that wouldn't really be an Apache thing come to think of it. Think coopster's on the right track.

AjiNIMC

5:57 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Even I guessed that, but i have checked it many times, the files are ofcourse there, and I have tried it with many other file with an extension .php, doestn't work.

That one was typo error phpinfo(); , I guess I will have to re-install that.

Thanks
Aji

coopster

6:06 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Does the info.html file actually parse the PHP? I mean, do you get information about the current state of PHP? Or just a white page with this text on it:

<? 
phpinfo();
?>

I apologize if it seems as though I am asking basics here, but we don't know exactly where you are at yet...

coopster

6:15 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I just thought of something else, too. Are you running PHP in CGI mode? You may want to have a look at Parsing PHP with HTML file extension [webmasterworld.com].