在 justhost 安装 Drupal 8 时出现以下一些错误,及解决办法

安装时出现以下错误,:
PHP OPcode caching Not enabled
PHP OPcode caching can improve your site's performance considerably. It is highly recommended to have OPcache installed on your server.
http://php.net/manual/en/opcache.installation.php

这个错误在 drupal 7安装时也出现。
Error Database support Disabled
Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that Drupal supports.
https://www.drupal.org/node/270#database


同上中文显示为:
PHP OPcode caching 未启用
PHP OPcode caching can improve your site's performance considerably. It is highly recommended to have OPcache installed on your server.

错误 数据库支持 已禁用
您的服务器不支持任何常见的 PDO 数据库扩展。请确认您的主机服务商是否支持 PDO (PHP Data Objects) 并且提供Drupal 支持的数据库。


本地测试好后上传出现错误:(这个是由于选用了 PHP 5.6,版本不对造成的)
Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /home4/brightbb/public_html/0001-eoutset/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php on line 132




目前 justhost 提供的 PHP 版本,有 6 个:
PHP 5.4(默认)
PHP 5.4 (Single php.ini)
PHP 5.4 (FastCGI)
PHP 5.6 [Beta, check site functionality for compatibility after enabling]
PHP 5.6 (Single php.ini) [Beta, check site functionality for compatibility after enabling]
PHP 5.6 (FastCGI) [Beta, check site functionality for compatibility after enabling]




解决办法:
以上这些错误都是因为 PHP 版本问题引起的。

justhost 默认 PHP 版本为:PHP 5.4

改为 PHP 5.4 (Single php.ini) 或 PHP 5.4 (FastCGI),drupal 7 就可以安装了。

drupal 8 需要 PHP 版本为:PHP 5.6 (Single php.ini) 或 PHP 5.6 (FastCGI)。
(注意:justhost 强烈建议使用PHP 5.6 (Single php.ini))



justhost如何更改PHP版本?
http://www.nocnhost.com/justhost-change-php-version

首先登录Justhost的cPanel网站控制面板,在”Software/Services“板块下点击”PHP Config“
接着选择你要的PHP版本(PHP 5.2、PHP 5.2 FastCGI、PHP 5.4、PHP 5.4 Fast CGI):
最后单击”Save Changes“完成。

Comments

Popular posts from this blog

potplayer 次字幕位置

emule kad 无法连接