メンテナンス・トラブルシュート - PHP - PHP 5.6 → PHP 7.2 - PHP アップグレード
- 1. 参考サイト
- 2. ports pkg のバージョン変更
1. 参考サイト
多くの方々が苦労されているようで。
あちこちに「PHP 5.6」から「PHP 7.x」へのアップグレードの注意事項の記事があります。
「portmaster で PHP 5.5 をモジュール含め一括で PHP 7.1 に更新する」などという魅力的な記事もあります。
だが、まぁここはいちいち苦労しながらやってみようかと思っています。
ちょっと気を付けたい記事等をメモ
「PHP を 7.2 にバージョンアップしたら正規表現でマッチしない現象に出くわした」
「PHP バージョン変更点をピックアップ(5.4.x ~ 7.2.x)」
2. ports pkg のバージョン変更
まずは「ports」、「pkg」のバージョン変更。
portupgrade -o lang/php72 -f php56
続けて打てると思っていたら、いきなり「PHP 7.2」のオプション設定から「make」がはじまってびっくり・・・。
わけわからないうちにすべてのオプションをチェックしてしまった・・・。
あとは続けざまにインストールしている「PHP」のモジュールのバージョンをあげていくしかないかな・・・。
portupgrade -o lang/php72-extensions -f php56-extensions
途中、オプションの設定画面が表示されましたが、最悪の場合、後で make しなおすこととして、デフォルトのまま続行。
また途中
Installing php72-ctype-7.2.7...
pkg-static: php72-ctype-7.2.7 conflicts with php56-ctype-5.6.36_1 (installs files into the same place). Problematic file: /usr/local/include/php/ext/ctype/config.h
*** Error code 70
Stop.
make[2]: stopped in /usr/ports/textproc/php72-ctype
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/lang/php72-extensions
*** Error code 1
Stop.
make: stopped in /usr/ports/lang/php72-extensions
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20180706-71946-9kz0s5 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=php56-extensions-1.0 UPGRADE_PORT_VER=1.0 make -DDISABLE_CONFLICTS
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
! lang/php72-extensions (php56-extensions-1.0) (unknown build error)
つうことで先に(同様のものが次々と出てくるので列挙します)
portupgrade -o textproc/php72-ctype -f textproc/php56-ctype
portupgrade -o textproc/php72-dom -f textproc/php56-dom
portupgrade -o security/php72-filter -f security/php56-filter
portupgrade -o security/php72-hash -f security/php56-hash
portupgrade -o converters/php72-iconv -f converters/php56-iconv
portupgrade -o devel/php72-json -f devel/php56-json
portupgrade -o converters/php72-mbstring -f converters/php56-mbstring
portupgrade -o www/php72-opcache -f www/php56-opcache
portupgrade -o databases/php72-pdo -f databases/php56-pdo
portupgrade -o databases/php72-pdo_sqlite -f databases/php56-pdo_sqlite
portupgrade -o archivers/php72-phar -f archivers/php56-phar
portupgrade -o sysutils/php72-posix -f sysutils/php56-posix
portupgrade -o www/php72-session -f www/php56-session
portupgrade -o textproc/php72-simplexml -f textproc/php56-simplexml
portupgrade -o databases/php72-sqlite3 -f databases/php56-sqlite3
portupgrade -o devel/php72-tokenizer -f devel/php56-tokenizer
portupgrade -o textproc/php72-xml -f textproc/php56-xml
portupgrade -o textproc/php72-xmlreader -f textproc/php56-xmlreader
portupgrade -o textproc/php72-xmlwriter -f textproc/php56-xmlwriter
上記は、インストールしている内容によって当然、変わります。
php-extensions が依存していないが、個別にアップグレードしなければならなかったのが
portupgrade -o graphics/php72-gd -f graphics/php56-gd
オプションはデフォルトのままにしました。
portupgrade -o devel/php72-gettext -f devel/php56-gettext
portupgrade -o databases/php72-pgsql -f databases/php56-pgsql
portupgrade -o archivers/php72-zip -f archivers/php56-zip
portupgrade -o www/mod_php72 -f www/mod_php56
こちらのオプションはデフォルトに加えて「ZTS」を有効にしました。
(当初「PHPDBG」「DEBUG」も有効にしたのですが、これはログの出力が変になったのでチェックをはずしました「php - ログの出力」参照)

|
|