Skip to content

Commit 0bf8e33

Browse files
author
epriestley
committedMar 13, 2018
Issue setup guidance recommending MySQLi and MySQL Native Driver
Summary: Fixes T12994. We need `MYSQLI_ASYNC` to implement client-side query timeouts, and we need MySQLi + MySQL Native Driver to get `MYSQLI_ASYNC`. Recommend users install MySQLi and MySQL Native Driver if they don't have them. These are generally the defaults and best practice anyway, but Ubuntu makes it easy to use the older stuff. All the cases we're currently aware of stem from `apt-get install php5-mysql` (which explicitly selects the non-native driver) so issue particular guidance about `php5-mysqlnd`. Test Plan: - Faked both issues locally, reviewed the text. - Will deploy to `secure`, which currently has the non-native driver. Maniphest Tasks: T12994 Differential Revision: https://secure.phabricator.com/D19216
1 parent 2b19f91 commit 0bf8e33

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed
 

‎resources/celerity/map.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4',
4747
'rsrc/css/application/config/config-options.css' => '4615667b',
4848
'rsrc/css/application/config/config-template.css' => '8f18fa41',
49-
'rsrc/css/application/config/setup-issue.css' => '7dae7f18',
49+
'rsrc/css/application/config/setup-issue.css' => '30ee0173',
5050
'rsrc/css/application/config/unhandled-exception.css' => '4c96257a',
5151
'rsrc/css/application/conpherence/color.css' => 'abb4c358',
5252
'rsrc/css/application/conpherence/durable-column.css' => '89ea6bef',
@@ -881,7 +881,7 @@
881881
'releeph-preview-branch' => 'b7a6f4a5',
882882
'releeph-request-differential-create-dialog' => '8d8b92cd',
883883
'releeph-request-typeahead-css' => '667a48ae',
884-
'setup-issue-css' => '7dae7f18',
884+
'setup-issue-css' => '30ee0173',
885885
'sprite-login-css' => '396f3c3a',
886886
'sprite-tokens-css' => '9cdfd599',
887887
'syntax-default-css' => '9923583c',

‎scripts/install/install_ubuntu.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ set +x
4545
sudo apt-get -qq update
4646
sudo apt-get install \
4747
$GIT mysql-server apache2 dpkg-dev \
48-
php5 php5-mysql php5-gd php5-dev php5-curl php-apc php5-cli php5-json
48+
php5 php5-mysqlnd php5-gd php5-dev php5-curl php-apc php5-cli php5-json
4949

5050
# Enable mod_rewrite
5151
sudo a2enmod rewrite

‎src/applications/config/check/PhabricatorPHPConfigSetupCheck.php

+45
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,51 @@ protected function executeChecks() {
6767
->addPHPConfig('always_populate_raw_post_data');
6868
}
6969

70+
if (!extension_loaded('mysqli')) {
71+
$summary = pht(
72+
'Install the MySQLi extension to improve database behavior.');
73+
74+
$message = pht(
75+
'PHP is currently using the very old "mysql" extension to interact '.
76+
'with the database. You should install the newer "mysqli" extension '.
77+
'to improve behaviors (like error handling and query timeouts).'.
78+
"\n\n".
79+
'Phabricator will work with the older extension, but upgrading to the '.
80+
'newer extension is recommended.'.
81+
"\n\n".
82+
'You may be able to install the extension with a command like: %s',
83+
84+
// NOTE: We're intentionally telling you to install "mysqlnd" here; on
85+
// Ubuntu, there's no separate "mysqli" package.
86+
phutil_tag('tt', array(), 'sudo apt-get install php5-mysqlnd'));
87+
88+
$this->newIssue('php.mysqli')
89+
->setName(pht('MySQLi Extension Not Available'))
90+
->setSummary($summary)
91+
->setMessage($message);
92+
} else if (!defined('MYSQLI_ASYNC')) {
93+
$summary = pht(
94+
'Configure the MySQL Native Driver to improve database behavior.');
95+
96+
$message = pht(
97+
'PHP is currently using the older MySQL external driver instead of '.
98+
'the newer MySQL native driver. The older driver lacks options and '.
99+
'features (like support for query timeouts) which allow Phabricator '.
100+
'to interact better with the database.'.
101+
"\n\n".
102+
'Phabricator will work with the older driver, but upgrading to the '.
103+
'native driver is recommended.'.
104+
"\n\n".
105+
'You may be able to install the native driver with a command like: %s',
106+
phutil_tag('tt', array(), 'sudo apt-get install php5-mysqlnd'));
107+
108+
109+
$this->newIssue('php.myqlnd')
110+
->setName(pht('MySQL Native Driver Not Available'))
111+
->setSummary($summary)
112+
->setMessage($message);
113+
}
114+
70115
}
71116

72117
}

‎src/docs/user/installation_guide.diviner

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Otherwise, here's a general description of what you need to install:
123123
- MySQL Server (usually "mysqld" or "mysql-server")
124124
- PHP (usually "php")
125125
- Required PHP extensions: mbstring, iconv, mysql (or mysqli), curl, pcntl
126-
(these might be something like "php-mysql" or "php5-mysql")
126+
(these might be something like "php-mysql" or "php5-mysqlnd")
127127
- Optional PHP extensions: gd, apc (special instructions for APC are available
128128
below if you have difficulty installing it), xhprof (instructions below,
129129
you only need this if you are developing Phabricator)

‎webroot/rsrc/css/application/config/setup-issue.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
}
8585

8686
.setup-issue-body {
87-
padding: 16px 16px 0 16px;
87+
padding: 16px;
8888
}
8989

9090
.setup-issue-status {

0 commit comments

Comments
 (0)
Failed to load comments.