concrete5 8.4.1をPHP7.2でエラー

2018年7月27日 at 20:36

concrete5 8.4.1 がリリースされたのでアップデートを行い、そのついでにPHPも7.2にしてみました。
その後にサイトを確認すると、下記のエラーが。

Cannot use Concrete\Core\Foundation\Object as Object because 'Object' is a special class name

サイトを2つ運営しているのでまとめてアップデートしたのですが、片方だけエラーが出てしまいました。
エラーが出た方もPHPを7.1にすると問題なく動きます。

考えられる原因はなんでしょうか。

【エラーが出ないサイトの環境情報】
# concrete5 Version
Core Version - 8.4.1
Version Installed - 8.4.1
Database Version - 20180710203437

# concrete5 Packages
Stucco (2.1.6)

# concrete5 Overrides
blocks/core_area_layout, blocks/page_list/templates, blocks/page_list, themes/stucco/css/img/headeing_dot.svg, themes/stucco/css/img/page_top_arrow.png, themes/stucco/css/img, themes/stucco/css/build/mobile/navigation.less, themes/stucco/css/build/mobile, themes/stucco/css/build/fonts/tomekon.less, themes/stucco/css/build/fonts/defaults.less, themes/stucco/css/build/fonts/ruri.less, themes/stucco/css/build/fonts/akane.less, themes/stucco/css/build/fonts/hisui.less, themes/stucco/css/build/fonts, themes/stucco/css/build/blocks/page-list.less, themes/stucco/css/build/blocks/social-button.less, themes/stucco/css/build/blocks/image-slider.less, themes/stucco/css/build/blocks/testimonial.less, themes/stucco/css/build/blocks/express_entry_list.less, themes/stucco/css/build/blocks/feature.less, themes/stucco/css/build/blocks/topic-list.less, themes/stucco/css/build/blocks/faq.less, themes/stucco/css/build/blocks/express_entry_detail.less, themes/stucco/css/build/blocks, themes/stucco/css/build/search.less, themes/stucco/css/build/header.less, themes/stucco/css/build/global-nav.less, themes/stucco/css/build/common.less, themes/stucco/css/build/breadcrumb.less, themes/stucco/css/build/footer.less, themes/stucco/css/build/pagination.less, themes/stucco/css/build/front-page.less, themes/stucco/css/build, themes/stucco/css/presets/tomekon.less, themes/stucco/css/presets/defaults.less, themes/stucco/css/presets/ruri.less, themes/stucco/css/presets/akane.less, themes/stucco/css/presets/hisui.less, themes/stucco/css/presets, themes/stucco/css/bootstrap-theme.min.css, themes/stucco/css/bootstrap.css, themes/stucco/css/styles.xml, themes/stucco/css/main.less, themes/stucco/css, themes/stucco/fonts/glyphicons-halflings-regular.woff, themes/stucco/fonts/glyphicons-halflings-regular.eot, themes/stucco/fonts/glyphicons-halflings-regular.svg, themes/stucco/fonts/glyphicons-halflings-regular.ttf, themes/stucco/fonts, themes/stucco/inc/header_home.php, themes/stucco/inc/header_top.php, themes/stucco/inc/header.php, themes/stucco/inc/footer.php, themes/stucco/inc, themes/stucco/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js, themes/stucco/js/vendor, themes/stucco/js/main.js, themes/stucco/js, themes/stucco/blank.php, themes/stucco/default.php, themes/stucco/description.txt, themes/stucco/full.php, themes/stucco/home.php, themes/stucco/left_sidebar.php, themes/stucco/page_forbidden.php, themes/stucco/page_not_found.php, themes/stucco/page_theme.php, themes/stucco/right_sidebar.php, themes/stucco/thumbnail.png, themes/stucco/view.php, themes/stucco

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.2.7

# PHP Extensions
apcu, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, gd, gettext, gmp, hash, iconv, intl, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, snmp, soap, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - -1
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
upload_max_filesize - 2M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - no value
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 10000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5


【エラーが出る方の環境情報】
# concrete5 Version
Core Version - 8.4.1
Version Installed - 8.4.1
Database Version - 20180710203437

# concrete5 Packages
Cloneamental (0.9.3), Manual Nav (2.2.0), Stucco (2.1.6), Supermint Theme (3.4.1.3)

# concrete5 Overrides
blocks/manual_nav/templates/manual_nav_topnav/view.php, blocks/manual_nav/templates/manual_nav_topnav, blocks/manual_nav/templates, blocks/manual_nav

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.1.19

# PHP Extensions
apcu, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, gd, gettext, gmp, hash, iconv, intl, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, snmp, soap, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - -1
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
sql.safe_mode - Off
upload_max_filesize - 30M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - no value
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 10000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

タグ:

Re: concrete5 8.4.1をPHP7.2でエラー

2018年7月29日 at 9:45
原因としてありそうなのは、以下の2つ(いずれか、または両方)が有力だと思います。

■ 使っているパッケージの中に、php7.2非対応のものがある
■ オーバーライドしたコードの中に、php7.2非対応のものがある
 

Re: concrete5 8.4.1をPHP7.2でエラー

2018年7月31日 at 8:23
Fumito Mizunoさん ありがとうございます。

concrete5 8.4.1に対応していれば良いわけではないんですね。
php7.2への対応具合を調べてみます。

ありがとうございました。
 

Re: concrete5 8.4.1をPHP7.2でエラー

2018年7月31日 at 12:00
まずはpackagesフォルダ内のObject(単語全体)を検索してみたらいいかもです。

Objectがクラス名として使われているのではと思います。
ObjectはPHP 7.2の予約語です:クラス名にはこれ以上使用できません。

英語の公式のサイトの方に出ていました。
パッケージは複数あるので、特定された対応策は出ていませんでしたが参考になれば・・・
 

Re: concrete5 8.4.1をPHP7.2でエラー

2018年8月1日 at 8:42
akiさま
返信ありがとうございます。

せっかく教えていただいたのに、恥ずかしながらわかりませんでした。
PHP7.2ではObjectという単語が命令?として使われるようになったので、どこかに使われていると問題が出るということでしょうか。
 

Re: Re: concrete5 8.4.1をPHP7.2でエラー

2018年8月20日 at 20:00
横から失礼

object は(PHP 7.2 以降)予約語になったものです。

「予約語」とは、コンピュータの世界では昔からあったもので、
予め、プログラミング言語などを制作する場合に、他と被らないように、
予約して、「他では使わないように」と宣言する(した)ものです。

object以外にも、PHPでも沢山の予約語があります。
これらの名前は、クラスやインターフェイスそしてトレイトの名前として使えません(別の用途・別の宣言など)。 名前空間の中であっても使うことはできません。

int (PHP 7 以降) float (PHP 7 以降) bool (PHP 7 以降) string (PHP 7 以降) true (PHP 7 以降) false (PHP 7 以降) null (PHP 7 以降)  void (PHP 7.1 以降) iterable (PHP 7.1 以降) など、

他にも定義済の定数、定義済のクラス、PHPのキーワード、コンパイル時の定数、などがあります。

http://php.net/manual/ja/reserved.php
 

Re: concrete5 8.4.1をPHP7.2でエラー

2018年8月24日 at 17:04
Yamachann11さま

PHPについて全く知識が無く恥ずかしい限りです。

少しずつ勉強してみたいと思います。

ありがとうございました。
 

Re: concrete5 8.4.1をPHP7.2でエラー

2018年7月31日 at 12:07
JINTANさま

オーバライドしたコードに問題ないという前提で...

Manual Nav は php7.2 でも動作しているので、おそらく Cloneamental か
Supermint Theme のどちらかではないでしょうか?
テーマとして使っているのであれば仕方ないですが、Stucco をお使いであれば一旦両テーマをアンインストールして確認してみては?

よろしくお願いします。
 

Re: Re: concrete5 8.4.1をPHP7.2でエラー

2018年8月1日 at 8:53
nipperさま

あっちでもこっちでもありがとうございます。

オーバーライドは一度更新忘れで失敗したことがありますので一度確認してみます。

テーマの方はなんとなくSupermint が影響しているように思ってはおりました。
こちらだと私のスキルではどうしようもなく、実際に使っているので更新をまつしかなさそうです。

ちょっと質問ですが、テーマというのはインストールしてあるだけでシステムに影響するのでしょうか。
もしするのであれば、使っていないテーマはアンインストールした方がいいのでしょうか。