PHP 7.0 的 Phabricator 安装错误

Phabricator Installation Error with PHP 7.0

我正在 Ubuntu 16.04 上安装 Phabricator。

我安装了 PHP 7.0.8-3。

我在 https://secure.phabricator.com/book/phabricator/article/configuration_guide/

的设置部分

当我访问我的网站时出现错误

1045: Access denied for user 'root'@'localhost' (using password: NO)

我尝试运行命令

 phabricator/ $ ./bin/storage upgrade --user <user> --password <password>

但是我得到以下错误:

[2016-07-07 17:15:54] EXCEPTION: (Error) Call to undefined function mysql_real_escape_string() at [/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php:12] arcanist(head=master, ref.master=4d4d16f25985), phabricator(head=master, ref.master=ef13b0e52b46), phutil(head=master, ref.master=32c56dc20b39) #0 AphrontMySQLDatabaseConnection::escapeBinaryString(string) called at [/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php:8] #1 AphrontMySQLDatabaseConnection::escapeUTF8String(string) called at [/src/xsprintf/qsprintf.php:178] #2 xsprintf_query(AphrontMySQLDatabaseConnection, string, integer, string, integer) called at [/src/xsprintf/xsprintf.php:70] #3 xsprintf(string, AphrontMySQLDatabaseConnection, array) called at [/src/xsprintf/qsprintf.php:64] #4 qsprintf(AphrontMySQLDatabaseConnection, string, string, string, string) called at [/src/xsprintf/queryfx.php:5] #5 queryfx(AphrontMySQLDatabaseConnection, string, string, string, string) called at [/src/xsprintf/queryfx.php:11] #6 queryfx_all(AphrontMySQLDatabaseConnection, string, string, string, string) called at [/src/aphront/storage/connection/AphrontDatabaseConnection.php:26] #7 AphrontDatabaseConnection::queryData(string, string, string, string) called at [/src/infrastructure/storage/lisk/LiskDAO.php:535] #8 LiskDAO::loadRawDataWhere(string, string) called at [/src/infrastructure/storage/lisk/LiskDAO.php:476] #9 LiskDAO::loadAllWhere(string, string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:18] #10 PhabricatorConfigDatabaseSource::loadConfig(string) called at [/src/infrastructure/env/PhabricatorConfigDatabaseSource.php:7] #11 PhabricatorConfigDatabaseSource::__construct(string) called at [/src/infrastructure/env/PhabricatorEnv.php:232] #12 PhabricatorEnv::buildConfigurationSourceStack() called at [/src/infrastructure/env/PhabricatorEnv.php:95] #13 PhabricatorEnv::initializeCommonEnvironment() called at [/src/infrastructure/env/PhabricatorEnv.php:75] #14 PhabricatorEnv::initializeScriptEnvironment() called at [/scripts/init_script.php:21] #15 init_phabricator_script() called at [/scripts/init_script.php:24] #16 require_once(string) called at [/scripts/sql/manage_storage.php:5]

更新:

自 2021 年 6 月 1 日起,不再维护或更新 Phabricator。 Click here for more info

您需要安装 php7 mysql 扩展程序

sudo apt-get install php7.0-mysql

Phabricator 不支持 PHP7.0(缺少 7.1 中存在的功能)。安装受支持的 PHP 版本,如 5.6 或 7.1+,是的,确保 mysql 扩展也在那里。