Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

phpinfo() not working in php setup


  • Please log in to reply
14 replies to this topic

#1 mbvpixies78

mbvpixies78

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 21 June 2010 - 03:27 PM

Computer:
Windows Vista Ultimate Service Pack 2
Firefox 3.6.3
php 5.2.5
apache 2.2.8
mysql 5.0.51a

intention:
set up my computer to host a web site using dynamic DNS from tzo.net and a wireless internet connection (I know, I need to get a wired connection for reliability, but for now, this is ok because I am just learning how to set it all up.)
-when I go to http://localhost I get the default web page from apache that says "It works!"

Steps taken:
I unzipped php 5.2.5 into c:\php
I added the following to httpd.conf in apache conf folder:

LoadModule php5_module c:/php5/php5apache2.dllAddType application/x-httpd-php .phpPHPIniDir "c:\php5"

I created a file named phpinfo.php into apache's htdocs folder which contains the following:
<?phpphpinfo();?>

This was intended to show me details about php in order to verify it is working. Instead, when I try to open phpinfo.php in my browser, it gets stuck in an endless loop of opening blank tab after blank tab and I have to close Firefox with the x button to get it to stop. I'm working from the 4th edition of Sam's Teach Yourself PHP, MySQL and Apache All-in-One 4th ed. It worked when I installed it all yesterday from scratch, but now it's not working. I uninstalled php, mysql and apache, rebooted and reinstalled. mysql and apache seem to be working fine, but php is not.

Note:
my computer says there's two versions of mysql installed-- 5 and 6, though I uninstalled them through Windows control panel. There might be lingering registry entries but I don't know if that has anything to do with php not working.

EDIT: Removed HJT log, not a malware issue as stated ~ Hamluis.

Edited by hamluis, 21 June 2010 - 04:14 PM.

System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:11:32 AM

Posted 21 June 2010 - 08:57 PM

First thing first, it is not a properly formatted program. PHP is used to create web pages which includes HTML tags. Something like this:
<html>
  <head>
	 <title></title>
  </head>
  <body>
	 <?php phpinfo(); ?>
  </body>
</html>

Problems with MYSQL will not affect PHP, unless the PHP needs to access MySQL for something.

#3 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 21 June 2010 - 09:48 PM

I added HTML tags. Still not sure why it doesn't work anymore. I scanned the registry with Norton System Works. I've also been looking at other forums but the repeating empty tab problem is happening for other people unrelated to Firefox or PHP. In one case it was a trojan, supposedly, hence the hijakcthis log post.
System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

#4 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:12:32 PM

Posted 21 June 2010 - 11:10 PM

Check out error.log in apache's logs folder. It logs all errors encountered.

#5 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 22 June 2010 - 10:59 AM

This is the only error in apache's error log:

[Mon Jun 21 13:17:13 2010] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache2.2/htdocs/favicon.ico
System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

#6 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:12:32 PM

Posted 22 June 2010 - 09:26 PM

Have you tried other PHP scripts, other than phpinfo() ?

Try this : echo "<h1>Hello, World from PHP !</h1>"; instead of phpinfo();

This is to see if PHP is installed properly or not. Try re-installing Apache in C:\Apache2

#7 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 23 June 2010 - 01:44 AM

I tried your script and it did the same thing-- opening endless empty tabs.
System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

#8 Taomech

Taomech

  • Members
  • 36 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Australia
  • Local time:03:32 AM

Posted 24 June 2010 - 01:59 AM

If you would prefer to not debug the error, you could try installing something like XAMPP, as it comes with PHP by default.
Otherwise, I cannot help any further.

Thanks,
Taomech

Edited by Taomech, 24 June 2010 - 02:00 AM.


#9 Wolfy87

Wolfy87

  • Members
  • 414 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:England
  • Local time:05:32 PM

Posted 25 June 2010 - 11:44 AM

Every thing is pointing to your PHP not being installed correctly, you could try reinstalling PHP, but as Taomech says, a program that does it all for you can some times be better if you just want to practice. I used WAMP server when I first started, it comes with apache (obviously), PHP and MySQL.

Hope that helps, Wolfy87.

#10 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 25 June 2010 - 12:09 PM

I installed XAMPP and still the repeated opening browser tabs. Thanks for the suggestion though.
System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

#11 Taomech

Taomech

  • Members
  • 36 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Australia
  • Local time:03:32 AM

Posted 26 June 2010 - 01:05 AM

Thanks mbvpixies78,
To clarify, when you open the file once, does it result in just one blank tab or many?

EDIT:
After further reading, this problem may be caused if Firefox is set as the default handler for .php files. When you try to open the php file, Firefox then opens it again and again, thus all the tabs. Only problem is that I am not sure if this is the problem. It only applies if when you open the file once, many tabs open.

Thanks,
Taomech

Edited by Taomech, 26 June 2010 - 01:25 AM.


#12 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 29 October 2010 - 12:37 PM

My computer had some data loss recently and I upgraded to Windows 7, have my web site started in a rudimentary fashion (working). After these initial posts a while back, if I'm not mistaken, there was an issue with a hidden .txt extension, but I may be remembering incorrectly. Now I am seeing the same problem again and wishing I'd posted what made it work last time... will do so when I figure it out this time.

i.e., multiple, endless blank tabs are being opened when I try to open a php file.
System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

#13 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 29 October 2010 - 12:44 PM

I just tried opening phpinfo().php in internet explorer and used different functions other than just phpinfo() and it asked me if I wanted to open or save the file. When I chose open, it opened it in Firefox because it's my default browser.
System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

#14 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 29 October 2010 - 03:01 PM

Also, renaming the file from .php to .html (I've enclosed the php script inside html tags) doesn't produce the repetitive opening of blank tabs, but instead simply opens 1 tab that is blank. It contains the title I gave it in the HTML portion of the code, but nothing else. This goes for any of the following, which is the testing script/html file I created to fix this problem:

html>
<head>
<title>phptest</title>
</head>
<body>
<?php
echo "PHP works!"

//Show all information, defaults to INFO_ALL
phpinfo();

//gets logo guid
//php_logo_guid();
//show version information
phpversion();
 
 //Show just the module information.
 //phpinfo(8) yields identical results
 phpinfo(INFO_MODULES);
 ?>
 </body>
 </html>

System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--

#15 mbvpixies78

mbvpixies78
  • Topic Starter

  • Members
  • 11 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Chicago
  • Local time:12:32 PM

Posted 29 October 2010 - 03:40 PM

Figured it out. You can't try to open a php file via the browser by typing your drive letter and then navigating through the list. This will cause infinite blank tab opening behavior.

What you need to do is type http://localhost/phpinfo.php and then it will work fine.

As to why this is, I can only guess. Maybe Firefox doesn't know what to do with a php file when you browse to it directly rather than through your local web site server (localhost), and thinks it's a request to open a new window, such as in some setups where this happens when a download is instantiated. Once the new window is open, the same php script, in the new window, is interpreted by Firefox as an instruction to open a new window, ad infinitum.

This is one of those minor types of bugs that makes you think php isn't working when it was all along. Still, it needs addressed.
System: DIY-- Gigabyte GA-M57SLI-S4 motherboard, Phenom 9950 2.6 GHz 4xcore processor, 8GB Kingston 800 RAM, Geforce 8500 GT, Windows 7 Professional, Firefox 3.6.12--




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users