Upgrading php 5.3 to 5.4 on nginx

Hello I have a linode with debian 6.0, nginx, php 5.3 and mysql installed and want to upgrade to php 5.4.

I added the following to my /etc/apt/sources

deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all

deb http://packages.dotdeb.org squeeze-php54 all
deb-src http://packages.dotdeb.org squeeze-php54 all

Then I ran:

apt-get update
apt-get install php5

The output is the following :

root@ginger:~# apt-get install php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
  libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap php5-cgi php5-cli php5-common php5-curl php5-gd php5-mcrypt
  php5-mysql ssl-cert
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom php-pear openssl-blacklist
The following packages will be REMOVED:
  php-apc php5-suhosin
The following NEW packages will be installed:
  apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
  libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap php5 ssl-cert
The following packages will be upgraded:
  php5-cgi php5-cli php5-common php5-curl php5-gd php5-mcrypt php5-mysql
7 upgraded, 11 newly installed, 2 to remove and 5 not upgraded.
Need to get 13.9 MB of archives.
After this operation, 14.8 MB of additional disk space will be used.

Couple of things that I am wondering, why is it installing apache related stuff? And why is it removing php-apc. Is it safe to upgrade php5.3 to php5.4 like this?

6 Replies

php5 is a metapackage that installs either an Apache module package or the CGI package. It seems to be defaulting to libapache2-mod-php5. You should be able to just install the CGI package with apt-get install php5-cgi.

Wouldn't a simple apt-get upgrade (after running the update command) do the trick, rather than trying to reinstall php5 altogether? Or am I thinking about it wrong?

apt-get upgrade returns this

The following packages have been kept back:
  mysql-client-5.5 mysql-server-5.5 mysql-server-core-5.5 newrelic-php5
  php5-cgi php5-cli php5-common php5-curl php5-dev php5-gd php5-mcrypt
  php5-mysql
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

I will try with apt-get install php5-cgi.

Seems like apt-get dist-upgrade might be the way to go.

root@ginger:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  php-apc php5-suhosin
The following NEW packages will be installed:
  libaio1 mysql-client-core-5.5 newrelic-daemon newrelic-php5-common
The following packages will be upgraded:
  mysql-client-5.5 mysql-server-5.5 mysql-server-core-5.5 newrelic-php5
  php5-cgi php5-cli php5-common php5-curl php5-dev php5-gd php5-mcrypt
  php5-mysql
12 upgraded, 4 newly installed, 2 to remove and 0 not upgraded.
Need to get 47.5 MB of archives.
After this operation, 24.0 MB of additional disk space will be used.
Do you want to continue [Y/n]? n

You should really be using php-fpm and not php-cgi.

What is the difference? And why does the linode LEMP guides install php-cgi?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct