LAMP Server ot working correctly

murphyslabrat

Senior member
Jan 9, 2007
314
0
0
The situation is as follows:

The PC is a Fujitsu Lifebook with a Pentium III cpu. I am using the Localhost alias to view the content on the same computer(am I correct in assuming that neither of these are significant?)

Installed Apache 2 and PHP5 with the Synaptic Package Manager (I am not at the computer, and I forget which versions of PHP and Apache 2; I did get the Apache 2 mod and dependent packages)

Restarted the PC after the installation, I haven't issued the "Stop/Start" commands, I just assumed that the restart would take care of it.

I just copied and pasted 2 lines of PHP script from one of w3schools' examples, so the code is definitely good.

I would love some help here, even if it is just questions about the setup.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Which flavor of Debian are you using?

Which script are you trying to use?

What kinds of error messages are you getting?

How are you trying to access the script file you created?

What is the output of 'ls -al /var/www'?

What about 'ps ax | grep apache2'?

You really didn't provide us with much to go with here.

The first thing I do to test new LAMP installs is to run a script whose only text is

<? phpinfo(); ?>
 

murphyslabrat

Senior member
Jan 9, 2007
314
0
0
ok, sorry about that. First, it was working for a little bit, but it stopped working after I tried to open a php file through the file-browser (default action is to open with Mozilla Firefox).
Whenever I try to load a php file, i get a download dialogue box instead of the page.

For instance: an html file that contains the following code:
<html>
<head></head>
<body>

<form action="php_test.php" method="get">
<input type="text" name="value1"><br>
<input type="submit">
</form>

</body>
</html>

and then a php file that contains the following code:

<html>
<head></head>
<body>
<?php echo("you typed: ".$_get["value1"]);?>
</body>
</html>

This is a recreation, not a copy and paste, so errors in this code were not neccessarily in the origional files.

Both of these files were in the same directory, in this case "/var/www/php_test_whythehellwontyouwork"

the same thing (download/open with dialogue instead of excecution) happens with all other methods of accessing/linking a php file.

 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Apache is not setup correctly then. Whenever I've setup a LAMP install on an Ubuntu box I just do 'apt-get install phpmyadmin'. That installs everything in one swoop :)