help beginner upgrade your php7.0 to latest 7.2

Hi, im beginner and big fan to freebsd. I dont know, if this is right place for my post, but i hope. 🍺
I installed on my old machine freebsd 11.0 with nextcloud 14 (FAMP). But now i wanting upgrade all packages and operating system.
Freebsd from 11.0 to 11.2 i already upgraded (with freebsd-update).

But have big problem with upgrading php7.0 to 7.2. Searched on internet some good tutorial for freebsd, how to upgrade php to 7.2, but dont finded any relevant for beginer, that will help me.

I trayed pkg upgrade php72, portmaster..... Still, after restart apache24 get errors in http-error.log, about misssing old folder for php extensions. So, next I trayed "ln -s" new extension folder ( for php 7.2) to old folder (for php 7.0), but get another errors, like, php api si compiled to another versions...

Thx, for all help.
 
Use packages.

pkg upgrade

So, next I trayed "ln -s" new extension folder ( for php 7.2) to old folder (for php 7.0), but get another errors, like, php api si compiled to another versions...
This is never a solution, so remove it.
 
use this command first,
pkg remove php71

then use this command,
pkg install php72

i used this successfully.
 
A pkg-upgrade(8) is likely to automatically work. PHP 7.2 is the default now so any web PHP web application that's installed is going to depend on PHP 7.2. The upgrade will therefor automatically "fix" the dependencies by removing the old PHP version and installing the current one.

The only thing you need to verify afterwards is that the corresponding mod_php72 is installed. I've had a few occasions where all things PHP where correctly updated but left the "old" mod_php* in place.
 
I've been wondering for a while about this, I've got lang/php71 installed via pkg, however running pkg upgrade never offers to upgrade PHP 7.1 to PHP 7.2. Its been like that for me since the notice that default version of PHP changed to PHP 7.2, but several times it has upgraded to newer versions of php71 packages.

What is likely blocking the upgrade?

Code:
# freebsd-version
11.2-RELEASE-p9

# cat /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}

# pkg update -f ; pkg upgrade
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB   1.7MB/s    00:04
Processing entries: 100%
FreeBSD repository update completed. 32083 packages processed.
All repositories are up to date.
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

Checking installed versions of PHP says its up to date with repository
Code:
# pkg version -vR | grep php
mod_php71-7.1.26_1                 =   up-to-date with remote
php71-7.1.26_1                     =   up-to-date with remote
...other php extensions...

However this suggests that the installed version is newer than the remote version
Code:
# pkg version | grep php
mod_php71-7.1.26_1                 >
php71-7.1.26_1                     >
...other php extensions...

So I guess the indexes are out of date, yet I've wiped /usr/ports/ and downloaded a fresh copy and the issue remains.

I realise I could manually do the upgrade by removing and reinstalling, I'm just confused as to why its not working automatically.
 
ok, a did this>
  1. pkg remove php70
  2. pkg install php72-ctype php72-dom php72-gd php72-iconv php72-json php72-mbstring php72-posix php72-simplexml php72-xmlreader php72-xmlwriter php72-zip php72-zlib php72-pdo_mysql php72-curl php72-fileinfo php72-bz2 php72-intl php72-pecl-mcrypt php72-openssl php72-exif php72-pecl-redis php72-pecl-imagick php72-pcntl php72-hash php72-xml php72-session php72-mysqli php72-wddx php72-xsl php72-filter php72-opcache

  1. installed without errors
  2. reboot server
  3. no page loaded in client browser (blank page)
  4. looked to log httpd-error.log:

Code:
[Sun Feb 10 16:07:26.044641 2019] [mpm_prefork:notice] [pid 713] AH00169: caught SIGTERM, shutting down
[Sun Feb 10 16:09:09.005459 2019] [ssl:warn] [pid 717] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/session.so' - Cannot open "/usr/local/lib/php/20151012/session.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/bz2.so' - Cannot open "/usr/local/lib/php/20151012/bz2.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/ctype.so' - Cannot open "/usr/local/lib/php/20151012/ctype.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/curl.so' - Cannot open "/usr/local/lib/php/20151012/curl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/dom.so' - Cannot open "/usr/local/lib/php/20151012/dom.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/exif.so' - Cannot open "/usr/local/lib/php/20151012/exif.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/fileinfo.so' - Cannot open "/usr/local/lib/php/20151012/fileinfo.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/filter.so' - Cannot open "/usr/local/lib/php/20151012/filter.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/gd.so' - Cannot open "/usr/local/lib/php/20151012/gd.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/hash.so' - Cannot open "/usr/local/lib/php/20151012/hash.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/iconv.so' - Cannot open "/usr/local/lib/php/20151012/iconv.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/imagick.so' - Cannot open "/usr/local/lib/php/20151012/imagick.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/intl.so' - Cannot open "/usr/local/lib/php/20151012/intl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/json.so' - Cannot open "/usr/local/lib/php/20151012/json.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/mbstring.so' - Cannot open "/usr/local/lib/php/20151012/mbstring.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/mcrypt.so' - Cannot open "/usr/local/lib/php/20151012/mcrypt.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/mysqli.so' - Cannot open "/usr/local/lib/php/20151012/mysqli.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/openssl.so' - Cannot open "/usr/local/lib/php/20151012/openssl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/pcntl.so' - Cannot open "/usr/local/lib/php/20151012/pcntl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/pdo.so' - Cannot open "/usr/local/lib/php/20151012/pdo.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/posix.so' - Cannot open "/usr/local/lib/php/20151012/posix.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/simplexml.so' - Cannot open "/usr/local/lib/php/20151012/simplexml.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/xml.so' - Cannot open "/usr/local/lib/php/20151012/xml.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/xmlwriter.so' - Cannot open "/usr/local/lib/php/20151012/xmlwriter.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/zip.so' - Cannot open "/usr/local/lib/php/20151012/zip.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/zlib.so' - Cannot open "/usr/local/lib/php/20151012/zlib.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/pdo_mysql.so' - Cannot open "/usr/local/lib/php/20151012/pdo_mysql.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/redis.so' - Cannot open "/usr/local/lib/php/20151012/redis.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/wddx.so' - Cannot open "/usr/local/lib/php/20151012/wddx.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/xmlreader.so' - Cannot open "/usr/local/lib/php/20151012/xmlreader.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20151012/xsl.so' - Cannot open "/usr/local/lib/php/20151012/xsl.so" in Unknown on line 0
[Sun Feb 10 16:09:11.041467 2019] [mpm_prefork:notice] [pid 717] AH00163: Apache/2.4.38 (FreeBSD) OpenSSL/1.0.2o-freebsd configured -- resuming normal operations
[Sun Feb 10 16:09:11.041683 2019] [core:notice] [pid 717] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Sun Feb 10 16:09:34.397332 2019] [:error] [pid 741] [client 192.168.1.16:50019] PHP Fatal error:  Class 'PDO' not found in /usr/local/www/apache24/data/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 172
[Sun Feb 10 16:09:34.719458 2019] [:error] [pid 742] [client 192.168.1.16:50023] PHP Fatal error:  Class 'PDO' not found in /usr/local/www/apache24/data/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 172
[Sun Feb 10 16:09:34.813241 2019] [:error] [pid 742] [client 192.168.1.16:50023] PHP Fatal error:  Class 'PDO' not found in /usr/local/www/apache24/data/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 172
 
hi,
I'm very happy, server is again online 😀, FreeBSD is cool.
Thanks all.

As you wrote i must do:
  1. pkg install mod_php72
  2. pkg install php72-pecl-APCu
 
I had php5 and mod_php5 and couldn't do an upgrade. Just removed them individually and then installed php73 and mod_php73. It updated my configs too and all worked well. No issues.
 
Back
Top