Forum
Missing page content after PHP upgrade
Hi guys,
Missing page content from a custom content region after upgrade to PHP 7. Here is a snippet from the PHP error log.
[22-Aug-2017 16:51:21 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function iconv() in /home/chatcom/public_html/perch/core/lib/PerchUtil.class.php:774
Stack trace:
#0 /home/chatcom/public_html/perch/core/lib/PerchTemplate.class.php(363): PerchUtil::urlify('Motorola DP1400')
#1 /home/chatcom/public_html/perch/core/lib/PerchTemplate.class.php(191): PerchTemplate->replace_content_tags('content', Array, ' \n\n<div class="...')
#2 /home/chatcom/public_html/perch/core/lib/PerchTemplate.class.php(106): PerchTemplate->render(Array, 1)
#3 /home/chatcom/public_html/perch/core/apps/content/PerchContent.class.php(532): PerchTemplate->render_group(Array, true)
#4 /home/chatcom/public_html/perch/core/apps/content/runtime.php(67): PerchContent->get_custom('Products - Moto...', Array)
#5 /home/chatcom/public_html/services/two-way-radio/index.php(127): perch_content_custom('Products - Moto...', Array)
#6 {main}
thrown in /home/chatcom/public_html/perch/core/lib/PerchUtil.class.php on line 774
[22-Aug-2017 16:51:34 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function iconv() in /home/chatcom/public_html/perch/core/lib/PerchUtil.class.php:774
Stack trace:
#0 /home/chatcom/public_html/perch/core/lib/PerchTemplate.class.php(363): PerchUtil::urlify('Motorola DP1400')
#1 /home/chatcom/public_html/perch/core/lib/PerchTemplate.class.php(191): PerchTemplate->replace_content_tags('content', Array, ' \n\n<div class="...')
#2 /home/chatcom/public_html/perch/core/lib/PerchTemplate.class.php(106): PerchTemplate->render(Array, 1)
#3 /home/chatcom/public_html/perch/core/apps/content/PerchContent.class.php(532): PerchTemplate->render_group(Array, true)
#4 /home/chatcom/public_html/perch/core/apps/content/runtime.php(67): PerchContent->get_custom('Products - Moto...', Array)
#5 /home/chatcom/public_html/services/two-way-radio/index.php(127): perch_content_custom('Products - Moto...', Array)
#6 {main}
thrown in /home/chatcom/public_html/perch/core/lib/PerchUtil.class.php on line 774
Diagnostic report...
Perch: 3.0.9, PHP: 7.0.22, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, fpm-fcgi
Installed apps: content (3.0.9), assets (3.0.9), categories (3.0.9)
App runtimes: <?php $apps_list = [ ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/chatcom/public_html/perch
PERCH_CORE: /home/chatcom/public_html/perch/core
PERCH_RESFILEPATH: /home/chatcom/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 32M, Total max file upload: 2M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/chatcom/public_html
HTTP_HOST: chat-com.com
So have you now installed
iconv
?Is that a required library that Perch needs?
Sorry Drew, I'm a little lost. I haven't altered Perch in any way, would I need to specify that in the PHP installation, or php.ini?
Cheers, E
The error you've given me says:
So that suggests that you don't have
iconv
installed.iconv
is used as a fallback if you don't have the internationalisation functions installed. So the alternative (perhaps better) is to enable those instead.https://php.net/manual/en/book.intl.php
More concerning to me is that if you've got an error complaining about the use of
iconv()
on like774
in that file, you're not running3.0.9
, as that version uses the function on like796
. So you should check what's going on and make sure your server hasn't been compromised.