[SOLVED] Installing simple-stats hoses website

Ask for help or provide support to other members.
Post Reply
clark
Posts: 2
Joined: Sat Mar 28, 2020 5:06 pm

[SOLVED] Installing simple-stats hoses website

Post by clark »

I have a fatal error (see below) in my server logs immediately after installing simple-statistics and the website won't load at all (I get basically a blank page).

I am evaluating the latest WonderCMS on CentOS 7 with Apache. Everything is stock CentOS 7 except I'm using PHP 7.2 from remi's yum repos.

I guess I'm missing dependency and I think the missing package is "php-pecl-dom-varimport.x86_64 : Convert nested arrays into DOMDocument" but I cannot install it because it's compiled for PHP5.x.

[Sat Mar 28 12:47:42.274575 2020] [php7:error] [pid 2089] [client 67.186.114.114:62225] PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /var/www/html/dev2/wondercms/plugins/simple-statistics/class.SimpleStatistics.php:135\nStack trace:\n#0 /var/www/html/dev2/wondercms/index.php(756): SimpleStatistics->alterAdmin(Array)\n#1 /var/www/html/dev2/wondercms/index.php(1717): Wcms->hook('settings', '\\n\\t\\t<div id="sav...')\n#2 /var/www/html/dev2/wondercms/themes/default/theme.php(23): Wcms->settings()\n#3 /var/www/html/dev2/wondercms/index.php(1114): require_once('/var/www/html/d...')\n#4 /var/www/html/dev2/wondercms/index.php(167): Wcms->loadThemeAndFunctions()\n#5 /var/www/html/dev2/wondercms/index.php(16): Wcms->render()\n#6 {main}\n thrown in /var/www/html/dev2/wondercms/plugins/simple-statistics/class.SimpleStatistics.php on line 135

Renaming plugins/simple-statistics fixes the issue (in the sense I can use the website again).
Last edited by clark on Sat Mar 28, 2020 6:27 pm, edited 1 time in total.
clark
Posts: 2
Joined: Sat Mar 28, 2020 5:06 pm

Re: Installing simple-stats hoses website

Post by clark »

clark wrote: Sat Mar 28, 2020 6:06 pm I guess I'm missing dependency and I think the missing package is "php-pecl-dom-varimport.x86_64 : Convert nested arrays into DOMDocument" but I cannot install it because it's compiled for PHP5.x.
I was wrong. The CentOS (remi) package is php-xml: "yum install php-xml" (and restarting Apache) fixed the issue for simple-statistics.

So, my issue is resolved, but I wonder if there's a way to check if DOMDocument is available before crashing? Or add "the DOM extension" to the requirements?
User avatar
StephanStanisic
Posts: 37
Joined: Fri Jul 05, 2019 8:51 pm

Re: [SOLVED] Installing simple-stats hoses website

Post by StephanStanisic »

Hi clark, what awesome to see someone try and use my plugin!

I have been busy for quite some time, so haven't had time to check the WonderCMS community.

Failing gracefully when DOMDocument isn't installed is a great idea, I can see how people installing from the GUI can have a hard time if DOMDocument isn't installed.

I've added it to the issue tracker: https://github.com/StephanStanisic/simp ... s/issues/9

Once I have time I'll start working on a fix.

Stephan
Post Reply