Getting php working with Apache on 10.04
Richard C. Steffens
rsteff at comcast.net
Sat Oct 1 14:25:18 UTC 2011
On 10/01/2011 01:47 AM, Ronald Chmara wrote:
> On Fri, Sep 30, 2011 at 7:14 PM, Richard C. Steffens<rsteff at comcast.net> wrote:
>> On 09/30/2011 03:32 PM, Finn wrote:
>>> which instructions did you follow?
>> The instructions on this page:
>> https://help.ubuntu.com/community/ApacheMySQLPHP
> What is the result of:
>
> "In /var/www , create a text file called "test.php", grant the world
> (or, at least, Ubuntu user "apache") permission to read it, write in
> it the only line: "<?php phpinfo(); ?>" (without the quotation marks)
> then, with your web browser, go to the URI
> "http://localhost/test.php": if you can see a description of PHP5
> configuration, it proves PHP 5 works with Apache."
>
> ... and if you invoke `httpd -M`, do you see a PHP module?,
rsteff at acer-laptop:~$ sudo httpd -M
[sudo] password for rsteff:
sudo: httpd: command not found
Seeing that I wondered if Apache was really running so I executed:
rsteff at acer-laptop:~$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified
domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully
qualified domain name, using 127.0.1.1 for ServerName
Then I renamed files so there was no index.php and there was the default
index.html.
Clicking on my link for localhost still showed me the download message
for index.php. That's not what happened when I first installed Apache.
So then I wondered if the problem is associated with the hostname issue
raised during the restart. When I put 127.0.1.1 in Firefox's address bar
I got the "It works" page. Then I renamed files so there is no
index.html and there is an index.php and reloaded 127.0.1.1. I get my
index.php page. I already have a link on that page for phpinfo, and it
works, too.
So, I was chasing the wrong problem.
The directions on this page:
http://aslamnajeebdeen.com/blog/how-to-fix-apache-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127011-for-servername-error-on-ubuntu
say that I need to put:
ServerName localhost
in /etc/apache2/httpd.conf. I did just that but when I put localhost in
Firefox's address bar I still get the download window. However, if
instead of just http://localhost I enter http://localhost/index.php I
get my index.php page.
Curiouser and curiouser.
Must be something I've missed.
--
Regards,
Dick Steffens
More information about the Ubuntu-us-or
mailing list