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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pathing between PHP and Apache2

Status
Not open for further replies.

mccartmd

Programmer
Feb 3, 2003
63
US
Hi: Have installed Apache2 up and running.
Have installed PHP5 and created txt file call phpinfo.txt
Placed php.ini into Windows\
Placed php5ts.dll into Windows\system
browsed
<html>
<body>
"PHP INFO";
</body>
</html>
and gives me PHP INFO. . .works.

but I try to put in PHPinfo() function.

<html>
<body><?php
phpinfo();
?></body>
</html>

. . gives me a blank.
Any Ideas/feedback why this is doing this
would be appreciated.
Thank You
M
 
How are you calling the file?

filename.[red]html[/red] or filename.[red]php[/red]

Also how are you accessing the file?

----------------------------------
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.
 
never mind, i saw your file name, php files need to have a PHP extension. so phpinfo.txt will not get sent to the PHP parser.



----------------------------------
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.
 
php files need to have a PHP extension

unless you instruct apache to pass other file extensions to the php handler.
 
True, True.

----------------------------------
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.
 
When in doubt check the apache error log. I can't tell you were that is at on Windows but on Unix it is typically /var/apache2/logs/error_log. So I would imagine wherever your htdocs folder is it there is also a folder in there called logs.

I will also have to agree with everyone else that you want to ensure your using .php file extentions. Furthermore ensure you have the AppType line in you httpd.conf file telling it how to handle the .php extention. It should be something like this:

AddType application/x-httpd-php .php .html .htm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top