summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Http/RequestHandlers/SetupWizard.php4
-rw-r--r--app/Services/PhpService.php11
2 files changed, 13 insertions, 2 deletions
diff --git a/app/Http/RequestHandlers/SetupWizard.php b/app/Http/RequestHandlers/SetupWizard.php
index 240dbe16b5..e41193c022 100644
--- a/app/Http/RequestHandlers/SetupWizard.php
+++ b/app/Http/RequestHandlers/SetupWizard.php
@@ -241,7 +241,7 @@ class SetupWizard implements RequestHandlerInterface
return $this->step3DatabaseType($data);
}
- $data['mysql_local'] = 'localhost:' . $this->php_service->iniGet(option: 'pdo_mysql.default_socket');
+ $data['mysql_local'] = 'localhost:' . $this->php_service->pdoMysqlDefaultSocket();
return $this->viewResponse('setup/step-4-database-' . $data['dbtype'], $data);
}
@@ -260,7 +260,7 @@ class SetupWizard implements RequestHandlerInterface
$data['errors']->push($ex->getMessage());
// Don't jump to step 4, as the error will make it jump to step 3.
- $data['mysql_local'] = 'localhost:' . $this->php_service->iniGet(option: 'pdo_mysql.default_socket');
+ $data['mysql_local'] = 'localhost:' . $this->php_service->pdoMysqlDefaultSocket();
return $this->viewResponse('setup/step-4-database-' . $data['dbtype'], $data);
}
diff --git a/app/Services/PhpService.php b/app/Services/PhpService.php
index 9fd0909832..c3bb47c936 100644
--- a/app/Services/PhpService.php
+++ b/app/Services/PhpService.php
@@ -27,6 +27,8 @@ use function ini_get;
use function ini_parse_quantity;
use function sys_get_temp_dir;
+use const PHP_OS_FAMILY;
+
/**
* Access to the PHP environment - to facilitate mocking/testing.
*/
@@ -62,6 +64,15 @@ class PhpService
return ini_parse_quantity(shorthand: $this->iniGet(option: 'memory_limit'));
}
+ public function pdoMysqlDefaultSocket(): string
+ {
+ if (PHP_OS_FAMILY === 'Windows') {
+ return '';
+ }
+
+ return $this->iniGet(option: 'pdo_mysql.default_socket');
+ }
+
public function postMaxSize(): int
{
return ini_parse_quantity(shorthand: $this->iniGet(option: 'post_max_size'));