I have Ubuntu-9.04 and am using XAMPP-1.7.2 to develop a web application. The problem is that when I try to view a PHP file I wrote by visiting
localhost/folder/file.php, Firefox offers me to download it instead of showing me the file as a web page. If I do download it and open it in my favorite text editor, I get an empty file with nothing in it...
UPDATE: Works on another server Well, I uploaded the page to another server, and I can see it fine! So the problem is not with Firefox. Nor is it with the code itself. My server or its configuration must be the problem. Does that give any of you a clue as to what's happening?
UPDATE: Isolating the problem Firefox offers to download only the first of these three files:
test1.php is offered as a download
<?php mysql_connect("localhost","root",""); mysql_close(); ?>
test2.php outputs: Warning: mysql_close(): no MySQL-Link resource supplied in /opt/lampp/htdocs/test.php on line 3
<?php //mysql_connect("localhost","root",""); mysql_close(); ?>
test3.php outputs a blank page
<?php mysql_connect("localhost","root",""); //mysql_close(); ?>
I know that my server is up and running and it tells me that PHP5 is on, and running as well.
Here is what I get in the XAMPP error log when the problem occurs (truncated and formatted for clarity):
[notice] child pid 7338 exit signal Segmentation fault (11)
Oh, and firefox can see the file without a problem on my other computer (windows XP SP3 and easyPHP as server) Does anyone know what I can do to solve this problem?
UPDATE: using error_log()
Here is my try at using error_log(): test4.php
<?php error_log("Start of file reached by PHP"); mysql_connect("localhost","root",""); error_log("mysql_connect executed"); mysql_close(); error_log("mysql_close executed"); ?>
This is what it produces in the XAMPP error log (trucated for clarity):
[error] [client 127.0.0.1] Start of file reached by PHP [error] [client 127.0.0.1] mysql_connect executed [notice] child pid 5338 exit signal Segmentation fault (11)