Page 1 of 1

PHPinfo not working for me

Posted: Tue Jul 14, 2009 3:50 pm
by crawler18
Hello,

I'm new, just starting to study and learn PHP ( I worked with mainframes for long,long,long time) and now I'm trying to get hold of PHP.

I installed Apache (last version) and php 5.
I wrote a small html to check the phpinfo

Code: Select all

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>phpinfo</title>
</head>
 
<body>
<?php phpinfo();  ?>
<h2> php info to see if this stuff works</h2>
</body>
</html>
 
I added the <h2> tags display the message so I know that it the html has been processed correctly. It does display the
"<h2> tag content.

I'm not sure where to look, in PHP or in Apache configuration as my "remote" server resides in the same laptop as my local HTML and PHP.


Could anyone give me some additional information why the phpinfo is not working?


Thanks

Re: PHPinfo not working for me

Posted: Tue Jul 14, 2009 4:08 pm
by aliciadg
try naming the file with the .php extension. All you really need in your code is this:

Code: Select all

<?php
phpinfo()
?>
 
Then name the file with a .php extension. The output will be formatted already as part of that function in php. This should work. Good luck!

Re: PHPinfo not working for me

Posted: Tue Jul 14, 2009 4:31 pm
by crawler18
Thanks for the reply.

I guess I have other issues going wrong since I used your information as per your reply.

I'm still getting the IIS 404 and the log is blank.


This is what I used:

http://localhost/phpinfo.php where: phpinfo.php is in C:/intepub/wwwroot.

Perhaps I have to review the apache/PHP parms and figure out what is missing or what is not corretly defined.



Thank you.

Re: PHPinfo not working for me

Posted: Tue Jul 14, 2009 4:46 pm
by aliciadg
Be sure to check and ensure that .php is set as a file type on your web server. I know this is a simple thing, but sometimes the simplest things are the ones that get missed and take up most of your time to figure out. Good luck again.

Re: PHPinfo not working for me

Posted: Wed Jul 15, 2009 1:08 pm
by crawler18
Thanks for the reply.

That's what I'm doing now. revising the installation and maybe reinstall from scratch with greater attention to details. :)