aboutsummaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-02 15:20:56 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-02 15:20:56 +0000
commitbb84319d6066d22034df42bbd3b0a82f1d46d474 (patch)
treee3457d403a0af6b193ba2fbd63eafaf34c25e93e /install
parentb04f30ecf2347104131b8dccf7bb349b5ec72762 (diff)
downloadelgg-bb84319d6066d22034df42bbd3b0a82f1d46d474.tar.gz
elgg-bb84319d6066d22034df42bbd3b0a82f1d46d474.tar.bz2
Closes #2129 - installer now works with web servers besides Apache - tested with nginx
git-svn-id: http://code.elgg.org/elgg/trunk@6998 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'install')
-rw-r--r--install/ElggInstaller.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php
index 6d1553572..359ed8f99 100644
--- a/install/ElggInstaller.php
+++ b/install/ElggInstaller.php
@@ -122,15 +122,15 @@ class ElggInstaller {
// check PHP parameters and libraries
$this->checkPHP($report);
- // @todo - rewrite this to handle different web servers
- // attempt to create .htaccess file
- $htaccessExists = $this->createHtaccess($report);
-
- // check rewrite module
- if ($htaccessExists) {
- $this->checkRewriteModule($report);
+ // check rewrite. If failure, create .htaccess and try again.
+ $rewriteResult = $this->checkRewriteRules($report);
+ if ($rewriteResult == FALSE) {
+ $htaccessExists = $this->createHtaccess($report);
+ if ($htaccessExists) {
+ $this->checkRewriteRules($report);
+ }
}
-
+
// check for existence of settings file
if ($this->checkSettingsFile() != TRUE) {
// no file, so check permissions on engine directory
@@ -871,11 +871,11 @@ class ElggInstaller {
}
/**
- * Confirm that Apache's rewrite module and AllowOverride are set up
+ * Confirm that the rewrite rules are firing
* @param array $report
* @return bool
*/
- protected function checkRewriteModule(&$report) {
+ protected function checkRewriteRules(&$report) {
global $CONFIG;
$url = "{$CONFIG->wwwroot}modrewrite.php";
@@ -885,13 +885,14 @@ class ElggInstaller {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = curl_exec($ch);
curl_close($ch);
$result = $response === 'success';
} else if (ini_get('allow_url_fopen')) {
// use file_get_contents as fallback
- $data = file_get_contents($url);
- $result = $data === 'success';
+ $response = file_get_contents($url);
+ $result = $response === 'success';
} else {
$report['htaccess'] = array(
array(
@@ -910,6 +911,9 @@ class ElggInstaller {
)
);
} else {
+ if (strpos($response, 'No input file specified.') !== FALSE) {
+ // nginx with no or bad rewrite rules
+ }
$report['htaccess'] = array(
array(
'severity' => 'failure',