awesomemotive / one-click-demo-import

One Click Demo Import plugin
https://www.awesomemotive.com/
195 stars 83 forks source link

PHP Warning: DOM support is not enabled #207

Closed seth586 closed 4 years ago

seth586 commented 4 years ago

Running a FreeBSD 11.3, nginx 1.16.1, mariaDB 10.4.12, php74 stack hosting wordpress. Installed a custom theme and tried running one-click-demo import. UI says complete but it ran too fast and the webpage is all messed up.

As a control study it imported correctly and works on a 3rd party commercial hosting solution.

The media logs were not very descriptive, & didnt indicate anything went wrong, so I tried the import with wp-cli for a more verbose output:

 $ wp ocdi import --content=campterra.xml
PHP Warning:  DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 391
Warning: DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 391
PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 1458
Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 1458
PHP Warning:  DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 391
Warning: DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 391
PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 1458
Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 1458
PHP Warning:  DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 412
Warning: DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 412
PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 1635
Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 1635
PHP Warning:  DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 412
Warning: DOM support is not enabled in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 412
...
...
...
PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 605
Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/one-click-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php on line 605
Success: Content import finished!

php74-dom-7.4.5 and php74-xml is installed on the host machine, and according to the php documentation, it is enabled by default.

Any ideas?

seth586 commented 4 years ago

And, of course, running the exact same configuration on ubuntu works.

seth586 commented 4 years ago

Found the solution: https://github.com/joyent/pkgsrc-legacy/issues/477

This appears to be a FreeBSD specific issue.

Build php74 from the ports collection, and add the following CONFIGURE_ARGS= flags:

--enable-dom
--enable-xmlreader

Then make sure the php74-dom and php74-xmlreader packages are not installed. If they are installed as a prerequisite for another package, just remove the extension ini from /usr/local/etc/php since these extensions are now compiled in directly.