diff --git a/cli/Valet/PhpFpm.php b/cli/Valet/PhpFpm.php index 686b857..9fd3c3d 100644 --- a/cli/Valet/PhpFpm.php +++ b/cli/Valet/PhpFpm.php @@ -74,11 +74,7 @@ function updateConfiguration() */ function updateIni() { - $contents = $this->files->get($this->fpmIniPath()); - - $contents = preg_replace('/^default_mimetype = .+$/m', 'default_mimetype = ""', $contents); - - $this->files->put($this->fpmIniPath(), $contents); + $this->files->copyAsUser(__DIR__.'/../stubs/valet.ini', $this->fpmIniPath()); } /** @@ -121,17 +117,17 @@ function fpmConfigPath() } /** - * Get the path to the FPM ini file for the current PHP version. + * Get the path to Valet's PHP ini file for the current PHP version. * * @return string */ function fpmIniPath() { $versionLookup = [ - 'php71' => '/usr/local/etc/php/7.1/php.ini', - 'php70' => '/usr/local/etc/php/7.0/php.ini', - 'php56' => '/usr/local/etc/php/5.6/php.ini', - 'php55' => '/usr/local/etc/php/5.5/php.ini', + 'php71' => '/usr/local/etc/php/7.1/conf.d/valet.ini', + 'php70' => '/usr/local/etc/php/7.0/conf.d/valet.ini', + 'php56' => '/usr/local/etc/php/5.6/conf.d/valet.ini', + 'php55' => '/usr/local/etc/php/5.5/conf.d/valet.ini', ]; return $versionLookup[$this->brew->linkedPhp()]; diff --git a/cli/stubs/valet.ini b/cli/stubs/valet.ini new file mode 100644 index 0000000..90e678a --- /dev/null +++ b/cli/stubs/valet.ini @@ -0,0 +1,3 @@ +; Disable the default Content-Type header to defer MIME type detection +; for static files to Caddy +default_mimetype = ""