Installing PHP on Ubuntu

I am now going to record my progress at installing PHP on Ubuntu, in the same way that I recording the results of installing Apache. Again, for my benefit, and your amusement. Are you laughing at me or with me?

jon@jon-desktop:~$ sudo apt-get install php5 libapache2-mod-php5
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
apache2-mpm-prefork php5-common
Suggested packages:
php-pear
The following packages will be REMOVED
apache2-mpm-worker
The following NEW packages will be installed
apache2-mpm-prefork libapache2-mod-php5 php5 php5-common
0 upgraded, 4 newly installed, 1 to remove and 0 not upgraded.
Need to get 3184kB of archives.
After unpacking 6324kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get: 1 http://security.ubuntu.com feisty-security/main apache2-mpm-prefork 2.2.3-3.2ubuntu0.1 [429kB]
Get: 2 http://security.ubuntu.com feisty-security/main php5-common 5.2.1-0ubuntu1.4 [223kB]
Get: 3 http://security.ubuntu.com feisty-security/main libapache2-mod-php5 5.2.1-0ubuntu1.4 [2531kB]
Get: 4 http://security.ubuntu.com feisty-security/main php5 5.2.1-0ubuntu1.4 [1078B]
Fetched 3184kB in 5s (609kB/s)
dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you request:
apache2 depends on apache2-mpm-worker (>= 2.2.3-3.2ubuntu0.1) | apache2-mpm-prefork (>= 2.2.3-3.2ubuntu0.1) | apache2-mpm-event (>= 2.2.3-3.2ubuntu0.1); however:
Package apache2-mpm-worker is to be removed.
Package apache2-mpm-prefork is not installed.
Package apache2-mpm-event is not installed.
(Reading database … 105677 files and directories currently installed.)
Removing apache2-mpm-worker …
* Stopping web server (apache2)… apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
Selecting previously deselected package apache2-mpm-prefork.
(Reading database … 105673 files and directories currently installed.)
Unpacking apache2-mpm-prefork (from …/apache2-mpm-prefork_2.2.3-3.2ubuntu0.1_i386.deb) …
Selecting previously deselected package php5-common.
Unpacking php5-common (from …/php5-common_5.2.1-0ubuntu1.4_i386.deb) …
Selecting previously deselected package libapache2-mod-php5.
Unpacking libapache2-mod-php5 (from …/libapache2-mod-php5_5.2.1-0ubuntu1.4_i386.deb) …
Selecting previously deselected package php5.
Unpacking php5 (from …/php5_5.2.1-0ubuntu1.4_all.deb) …
Setting up apache2-mpm-prefork (2.2.3-3.2ubuntu0.1) …
* Starting web server (apache2)… apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]

Setting up php5-common (5.2.1-0ubuntu1.4) …
Setting up libapache2-mod-php5 (5.2.1-0ubuntu1.4) …

Creating config file /etc/php5/apache2/php.ini with new version
* Forcing reload of web server (apache2)… apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]

Setting up php5 (5.2.1-0ubuntu1.4) …

2 Comments on “Installing PHP on Ubuntu”

  1. So, what do you do about that last error? I’ve gotten the same exact output when installing Apache2 on my ubuntu system, and haven’t figured it out yet. I’d just like to view my /var/www/ from the internet.

  2. That’s a good question. I wish I had blogged it! I did install Webmin to manage the server, but in the end I just ensured that that the Apache config files were set up correctly, i.e. etc/apache2/sites-available/default

    This did allow me to view the website I created OK. Incidentally, since setting this up, I moved my web files into my home directory. This is recommended if you plan to blog, as it makes setting up ftp much easier.

    As for getting the website /Apache to work, first check the config files, and if that fails, then try a reinstall! I had to reinstall once. Probably was not essential, but it got the job done. Obviously much easier if you have a dedicated server, rather than trying to set up a web server on a computer that is being used for loads of other stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *