FreeBSD 11: Tips and Tricks

UP: TOC

This brief tutorial shows a package upgrade from PHP70 to PHP7.1 on FreeBSD 11.

cd /root; pkg info php70\* > ~/installed-php70.txt; cat installed-php70.txt php70-7.0.18 php70-ctype-7.0.18 php70-curl-7.0.18 php70-dom-7.0.18 php70-exif-7.0.18 php70-fileinfo-7.0.18 php70-filter-7.0.18 php70-gd-7.0.18 php70-hash-7.0.18 php70-imap-7.0.18 php70-intl-7.0.18 php70-json-7.0.18 php70-mbstring-7.0.18 php70-mcrypt-7.0.18 php70-opcache-7.0.18 php70-openssl-7.0.18 php70-pdo-7.0.18 php70-pdo_pgsql-7.0.18 php70-pgsql-7.0.18 php70-phar-7.0.18 php70-session-7.0.18 php70-tokenizer-7.0.18 php70-xml-7.0.18

Delete the PHP70 packages:

cat ~/installed-php70.txt | xargs pkg delete -fy Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 24 packages (of 0 packages in the universe): Installed packages to be REMOVED: php70-7.0.18 php70-ctype-7.0.18 php70-curl-7.0.18 php70-dom-7.0.18 php70-exif-7.0.18 php70-fileinfo-7.0.18 php70-filter-7.0.18 php70-gd-7.0.18 php70-hash-7.0.18 php70-imap-7.0.18 php70-intl-7.0.18 php70-json-7.0.18 php70-mbstring-7.0.18 php70-mcrypt-7.0.18 php70-opcache-7.0.18 php70-openssl-7.0.18 php70-pdo-7.0.18 php70-pdo_pgsql-7.0.18 php70-pgsql-7.0.18 php70-phar-7.0.18 php70-session-7.0.18 php70-tokenizer-7.0.18 php70-xml-7.0.18

Issue the following command as prepared before


cd /usr/ports/archivers/php71-phar/ && make install clean
cd /usr/ports/converters/php71-mbstring/ && make install clean
cd /usr/ports/databases/php71-pdo/ && make install clean
cd /usr/ports/databases/php71-pdo_pgsql/ && make install clean
cd /usr/ports/databases/php71-pgsql/ && make install clean
cd /usr/ports/devel/php71-intl/ && make install clean
cd /usr/ports/devel/php71-json/ && make install clean
cd /usr/ports/devel/php71-tokenizer/ && make install clean
cd /usr/ports/graphics/php71-gd/ && make install clean
cd /usr/ports/mail/php71-imap/ && make install clean
cd /usr/ports/security/php71-filter/ && make install clean
cd /usr/ports/security/php71-hash/ && make install clean
cd /usr/ports/security/php71-mcrypt/ && make install clean
cd /usr/ports/security/php71-openssl/ && make install clean
cd /usr/ports/sysutils/php71-fileinfo/ && make install clean
cd /usr/ports/textproc/php71-xml/ && make install clean
cd /usr/ports/www/php71-opcache/ && make install clean
cd /usr/ports/www/php71-session/ && make install clean
cd /usr/ports/textproc/php71-ctype/ && make install clean

Restart the relevant services after the installation

service redis restart ; service nginx restart ; service php-fpm restart ;

The whole upgrade took approx. 30 minutes.

UP: TOC