Enabling PHP on the Ubuntu 8.04 with apache2

Asked by v.peregoncev

Hello,
I am new to the system Ubuntu 8.04 so far i like it but there is a problem that i have with enabling PHP to work with Apache2. I have a fresh isntalation of the Ubuntu 8.04 and i have used a Synaptic Packadge manager to install Apache2 and PHP. No other configuration i have changed i copied a file
Index.php to the WWW folder and when i go to the localhost/index.php it does not load it just asks me if i want it download it. It looks like PHP is not enabled. Please help me.

Content of Index.php file:
<? phpinfo(); ?>

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apache2 Edit question
Assignee:
No assignee Edit question
Solved by:
Bhavani Shankar
Solved:
Last query:
Last reply:
Revision history for this message
Best Bhavani Shankar (bhavi) said :
#1
Revision history for this message
v.peregoncev (v-peregoncev) said :
#2

I have looked in the support even closer and this what i got -
 Albert Damen said on 2008-09-14:

a2enmod only takes the module name, without the extension.
So "sudo a2enmod php5" should enable php5.
After that, you will need to run "/etc/init.d/apache2 force-reload" to make apache2 use php5.

The last line that he we reloaded the apache2 is not working for me :( when i have tried entering this in the system that what i have got -
------------------ Therminal ------------------------------------------------
vladimir@vladimir-desktop:~$ /etc/init.d/apache2 force-reload
open: Permission denied
 * Reloading web server config apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
httpd not running, trying to start
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
open: Permission denied
--------------------- Ending Therminal -----------------------------------

Revision history for this message
v.peregoncev (v-peregoncev) said :
#3

Thanks Bhavani Shankar, that solved my question.

Revision history for this message
charles (clb) said :
#4

I tried these steps and they didn't work for me. The step that says:
  sudo apt-get install libapache2-mod-php4 ...
failed (no installation candidate) and the php I found is php5, but no libphp4 or libphp5.
Thus I am no closer to success than before.
Ubuntu 8.4 I think as Kubuntu.
Sorry, I am new to Ubuntu and am baffled by the strange way it does things.