查看了 apache 服务器的错误日志,当在php7.0.7的时候,错误如下:
代码: 全选
[Mon Jun 13 23:42:25.103856 2016] [:error] [pid 5193] [client 192.168.1.103:21071] PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php:1733\nStack trace:\n#0 /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php(1353): s9e\\TextFormatter\\Configurator\\Helpers\\TemplateHelper::loadTemplate('<br/>')\n#1 /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php(6209): s9e\\TextFormatter\\Configurator\\Helpers\\TemplateForensics->__construct('<br/>')\n#2 /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php(8722): s9e\\TextFormatter\\Configurator\\RulesGenerators\\EnforceContentModels->__construct()\n#3 /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php(8370): s9e\\TextFormatter\\Configurator\\Collections\\RulesGeneratorList->normalizeValue('EnforceContentM...')\n#4 /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php(4765): s9e\\TextFormatter\\Configurator\\Collections\\NormalizedList->append('EnforceContentM...')\n#5 /home/davidyin/example.com/vendor in /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php on line 1733, referer: http://example.com/ucp.php?i=178
代码: 全选
[Tue Jun 14 11:06:07.398958 2016] [:error] [pid 2661] [client 192.168.1.103:9744] PHP Fatal error: Class 'DOMDocument' not found in /home/davidyin/example.com/vendor/s9e/text-formatter/src/Configurator.php on line 1745, referer: http://example.com/ucp.php?i=178
昨晚提交的,今早 David Colón 就回复说,是缺少了 php-xmlrpc。于是我加上了这个扩展到 php,两个版本都有加,但是还是同样错误。
他还提议我去 https://github.com/s9e/TextFormatter 提交issue。 我也去看了,没有看出所以然来。
但是这给我一个灵感,就是逐个对比 php扩展,拿本站的php环境同我安装测试版的php环境相比较。
最后的结果是,当我添加了 php-xml 扩展之后,这个问题就解决了。
所以最后的结论就是: php7.0-xml 或者 php5.6-xml 是必须的。