Solved Upgrade PHP 5.4.45 to 5.5 or 5.6 from ports

Hello,

I have a few servers based on FreeBSD 9.3 with PHP 5.4 like this one:
Code:
# pkg info | grep php
mod_php5-5.4.45,1              PHP Scripting Language
php5-5.4.45                    PHP Scripting Language
php5-bz2-5.4.45                The bz2 shared extension for php
php5-ctype-5.4.45              The ctype shared extension for php
php5-dom-5.4.45                The dom shared extension for php
php5-extensions-1.7            A "meta-port" to install PHP extensions
php5-fileinfo-5.4.45           The fileinfo shared extension for php
php5-filter-5.4.45             The filter shared extension for php
php5-gd-5.4.45                 The gd shared extension for php
php5-gettext-5.4.45            The gettext shared extension for php
php5-hash-5.4.45               The hash shared extension for php
php5-iconv-5.4.45              The iconv shared extension for php
php5-imap-5.4.45               The imap shared extension for php
php5-json-5.4.45               The json shared extension for php
php5-mbstring-5.4.45           The mbstring shared extension for php
php5-mcrypt-5.4.45             The mcrypt shared extension for php
php5-mysql-5.4.45              The mysql shared extension for php
php5-mysqli-5.4.45             The mysqli shared extension for php
php5-openssl-5.4.45            The openssl shared extension for php
php5-pdo-5.4.45                The pdo shared extension for php
php5-pdo_mysql-5.4.45          The pdo_mysql shared extension for php
php5-pdo_sqlite-5.4.45         The pdo_sqlite shared extension for php
php5-phar-5.4.45               The phar shared extension for php
php5-posix-5.4.45              The posix shared extension for php
php5-pspell-5.4.45             The pspell shared extension for php
php5-session-5.4.45            The session shared extension for php
php5-simplexml-5.4.45          The simplexml shared extension for php
php5-sqlite3-5.4.45            The sqlite3 shared extension for php
php5-tokenizer-5.4.45          The tokenizer shared extension for php
php5-xml-5.4.45                The xml shared extension for php
php5-xmlreader-5.4.45          The xmlreader shared extension for php
php5-xmlrpc-5.4.45             The xmlrpc shared extension for php
php5-xmlwriter-5.4.45          The xmlwriter shared extension for php
php5-zip-5.4.45                The zip shared extension for php
php5-zlib-5.4.45               The zlib shared extension for php
phpMyAdmin-4.5.1               Set of PHP-scripts to manage MySQL over the web

What is the best way to upgrade php 5.4.45 to 5.5 or maybe 5.6 from ports?
Can I use portupgrade for it?
Should I upgrade to 5.5 or to 5.6?

Thanks in advance.
 
What is the best way to upgrade php 5.4.45 to 5.5 or maybe 5.6 from ports?
The simplest and least error prone is to simply delete PHP and everything that depends on it and (re)install the ports you need. You can probably do pkg set -o lang/php5:lang/php55 followed by a portmaster -r lang/php55 but it's quite easy to end up in a "dependency-hell".

If you build from ports be sure to set this in /etc/make.conf to force a specific version:
Code:
DEFAULT_VERSIONS+= php=55
The default PHP version is currently 5.6.

As for PHP 5.5 vs. PHP 5.6 that really depends on what would be using PHP. I've encountered a lot of issues with applications that aren't quite ready for 5.6 yet. So the safest would be to stick to 5.5.
 
That's where your own pkg repository would be handy. You could build everything in advance using the new default versions separate to the running system. When your build is ready you just let pkg upgrade do its magic, no need to delete anything.
 
Back
Top