Forum
PHP Extension to use Perch shortcodes
Hi,
I was working on the Perch CMS shortcode and ran across a small php error. I think I'm missing one or more PHP extensions for DOMDocument.
Could I ask to confirm which extensions I need to install?
When I try to save a tweet shortcode formatted like this
[cms:tweet 859758174781538305 lang=en]
My server threw the following error:
Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/scottgruber.me/html/perch/core/lib/ParsedownExtra.class.php:2012 Stack trace: #0 /var/www/scottgruber.me/html/perch/core/lib/ParsedownExtra.class.php(1775): ParsedownExtra->processTag('<blockquote cla...') #1 /var/www/scottgruber.me/html/perch/core/lib/ParsedownExtra.class.php(198): ParsedownExtra->blockMarkupComplete(Array) #2 /var/www/scottgruber.me/html/perch/core/lib/ParsedownExtra.class.php(57): Parsedown->lines(Array) #3 /var/www/scottgruber.me/html/perch/core/lib/ParsedownExtra.class.php(1593): Parsedown->text('Following the [...') #4 /var/www/scottgruber.me/html/perch/core/lib/PerchParsedown.class.php(14): ParsedownExtra->text('Following the [...') #5 /var/www/scottgruber.me/html/perch/core/lib/PerchFieldTypes.class.php(690): PerchParsedown->text('Following the [...') #6 /var/www/scottgruber.me/html/perch/core/apps/content/PerchContent_Util.class.php(279): PerchFieldType_textarea->get_raw(Array, Object(PerchContent_CollectionItem)) #7 /var/www/ in /var/www/scottgruber.me/html/perch/core/lib/ParsedownExtra.class.php on line 2012
Here are my diagnostics:
Perch Runway: 3.0.3, PHP: 7.0.15-0ubuntu0.16.04.4, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (3.0.3), assets (3.0.3), categories (3.0.3), perch_forms (1.9), perch_kraken (1.1), perch_mailchimp (3.1), perch_twitter (3.7)
App runtimes: <?php $apps_list = array( 'perch_mailchimp', 'perch_forms', 'perch_twitter', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/scottgruber.me/html/perch
PERCH_CORE: /var/www/scottgruber.me/html/perch/core
PERCH_RESFILEPATH: /var/www/scottgruber.me/html/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 128M, Max POST 128M, Memory: 256M, Total max file upload: 128M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: scottgruber.me
DOCUMENT_ROOT: /var/www/scottgruber.me/html
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
And my hosting settings.
PHP: 7.0.15-0ubuntu0.16.04.4
Zend: 3.0.0
OS: Linux
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $
MySQL server: 5.7.18-0ubuntu0.16.04.1
Free disk space: 26.19 GB
Extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, apcu, calendar, ctype, curl, exif, fileinfo, ftp, gd, gettext, iconv, imagick, json, mysqli, pdo_mysql, Phar, posix, readline, shmop, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, Zend OPcache
GD: Yes
ImageMagick: Yes
PHP max upload size: 128M
PHP max form post size: 128M
PHP memory limit: 256M
Total max uploadable file size: 128M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
HTTPS: on
It's DOM, which is usually packaged with the XML functionality. It's usually standard.
Thanks. Installing php-xml and php-mbstring did the trick.