PHPinfo not working for me

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
crawler18
Forum Newbie
Posts: 3
Joined: Tue Jul 14, 2009 3:34 pm

PHPinfo not working for me

Post 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
aliciadg
Forum Newbie
Posts: 16
Joined: Tue Jul 14, 2009 3:39 pm

Re: PHPinfo not working for me

Post 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!
crawler18
Forum Newbie
Posts: 3
Joined: Tue Jul 14, 2009 3:34 pm

Re: PHPinfo not working for me

Post 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.
aliciadg
Forum Newbie
Posts: 16
Joined: Tue Jul 14, 2009 3:39 pm

Re: PHPinfo not working for me

Post 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.
crawler18
Forum Newbie
Posts: 3
Joined: Tue Jul 14, 2009 3:34 pm

Re: PHPinfo not working for me

Post 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. :)
Post Reply