Upgrading to PHP 5.4 and MySQL 5.5 on Debian 6 “Squeeze”

I recently upgraded my PHP and MySQL on my Turnkey Linux server.

PHP 5.4 isn’t available in the Squeeze stable repository so I added the Dotdeb repositories to my /etc/apt/sources.list.d/sources.list file

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 added their GPG key to my trusted repositories

wget http://www.dotdeb.org/dotdeb.gpg | apt-key add -
apt-get update

Then, I threw caution to the winds and

apt-get dist-upgrade

Which upgraded PHP but not MySQL so
apt-get install mysql-server

Then to my dismay

130618 19:07:21 [ERROR] /usr/sbin/mysqld: unknown variable 'default-character-set=utf8'
130618 19:07:21 [ERROR] Aborting

!?!

It turns out that in the new version of MySQL they have deprecated

default-character-set = utf8

So I went in and edited /etc/mysql/conf.d/force_utf8.cnf and changed that line to

character-set-server=utf8

And MySQL started up jest fin (Phew!) but lo and behold I wasn’t out of the woods just yet. Running the command

php -v

Threw the error

Failed loading /usr/lib/php5/20090626/xcache.so:  /usr/lib/php5/20090626/xcache.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib/php5/20090626/xdebug.so:  /usr/lib/php5/20090626/xdebug.so: cannot open shared object file: No such file or directory

So…

apt-get purge php5-xcache php5-xdebug

Now php -v wasn’t throwing an error but I didn’t want to do without an opcode cache so I reinstalled Xdebug but went with APC for my opcode cache. I’ve read that it is getting folded in to php 5.5 so I’d like to get used to using it anyway

apt-get install php5-xdebug php5-apc

  3 comments for “Upgrading to PHP 5.4 and MySQL 5.5 on Debian 6 “Squeeze”

  1. Bryan
    July 15, 2013 at 7:27 pm

    Genius, thanks Ryan!

  2. Bryan
    July 15, 2013 at 7:30 pm

    However, was the final command supposed to be:

    apt-get install php5-xdebug php5-apc

    ?

    • February 21, 2015 at 7:24 am

      Good catch! I’ll make the fix.

Leave a Reply

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