PHP Does Not Work!

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP Does Not Work!

Postby ticonzero » 02. April 2010 11:51

Hello, when I try to open a web page with the following:

<?php

echo "<pre>";
print_r(ini_get_all());
echo "</pre>";

?>

That is the code to display the php.ini configuration; instead of it I get this:

Image

Here you may download the Apache LOG file: http://www.filehosting.org/file/details/129712/apache_LOG.zip
How to fix it please?


Thank you.


Ticonzero
ticonzero
 
Posts: 15
Joined: 02. April 2009 16:31

Re: PHP Does Not Work!

Postby Nobbie » 02. April 2010 12:11

Unfortunately, you suppressed the most important info, the browser URL of your script. What did you enter in your browser to open your script?
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04

Re: PHP Does Not Work!

Postby ticonzero » 02. April 2010 12:26

Ok! When I open the URL in Firefox, address bar, no problem; the issue occurs when I go in the folder and there I right click on the PHP file and I open it with Firefox. I did not get that issue before.

The browser URL is the following: http://194.119.202.161/nubuilder/produc ... estPHP.php

Thank you for your interest.


Ticonzero.
ticonzero
 
Posts: 15
Joined: 02. April 2009 16:31

Re: PHP Does Not Work!

Postby Nobbie » 02. April 2010 13:13

ticonzero wrote:the issue occurs when I go in the folder and there I right click on the PHP file and I open it with Firefox


This is not surprising, as you dont open the file via HTTP protocoll (which involves Apache as webserver) but simply as file. You could even stop and/or remove Apache and PHP and the right click (or double click) will still open the file with the appropriate tool (either an editor, a browser or whatever you have assigned to the extension .php).

ticonzero wrote:The browser URL is the following: http://194.119.202.161/nubuilder/produc ... estPHP.php


Only if you enter it manually. On right or double click in the windows explorer you will see the file:// protocoll instead of http:// in the browser URL.

So this is not an Apache or PHP issue, neither a browser issue, it behaves as designed.
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04

Re: PHP Does Not Work!

Postby MC10 » 03. April 2010 22:04

Yes; if you use the file: protocol, the file won't go through the PHP interpreter.
MC10
 
Posts: 148
Joined: 20. February 2010 20:13

Re: PHP Does Not Work!

Postby zeuser » 04. April 2010 04:57

ticonzero wrote:Hello, when I try to open a web page with the following:

<?php

echo "<pre>";
print_r(ini_get_all());
echo "</pre>";

?>

That is the code to display the php.ini configuration; instead of it I get this:

Image

Here you may download the Apache LOG file: http://www.filehosting.org/file/details/129712/apache_LOG.zip
How to fix it please?


Thank you.


Ticonzero


I tried exactly the same code on my install and got the same results. Note: I did type http://localhost/test.html though. As a .php it works just fine. But not as a html file.
zeuser
 
Posts: 4
Joined: 04. April 2010 04:14

Re: PHP Does Not Work!

Postby MC10 » 04. April 2010 17:50

That's because the PHP interpreter doesn't process .htm or .html files. You can alter your Apache configuration to do that, but that is not recommended.
MC10
 
Posts: 148
Joined: 20. February 2010 20:13


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 50 guests