mirror of
https://github.com/laravel/valet.git
synced 2026-02-08 01:10:08 +01:00
Point PHP-FPM error_log to user directory
Old: `/usr/local/var/log/php-fpm.log` New: `~/.config/valet/Log/php-fpm.log` (We already put `~/.config/valet/Log/nginx-error.log` there) This avoids ARM Mac differences in directory paths.
This commit is contained in:
@@ -38,7 +38,7 @@ function install()
|
||||
$this->brew->ensureInstalled('php', [], $this->taps);
|
||||
}
|
||||
|
||||
$this->files->ensureDirExists('/usr/local/var/log', user());
|
||||
$this->files->ensureDirExists(VALET_HOME_PATH . '/Log', user());
|
||||
|
||||
$this->updateConfiguration();
|
||||
|
||||
@@ -77,7 +77,7 @@ function updateConfiguration()
|
||||
}
|
||||
|
||||
if (false === strpos($fpmConfigFile, '5.6')) {
|
||||
// for PHP 7 we can simply drop in a valet-specific fpm pool config, and not touch the default config
|
||||
// since PHP 7 we can simply drop in a valet-specific fpm pool config, and not touch the default config
|
||||
$contents = $this->files->get(__DIR__.'/../stubs/etc-phpfpm-valet.conf');
|
||||
$contents = str_replace(['VALET_USER', 'VALET_HOME_PATH'], [user(), VALET_HOME_PATH], $contents);
|
||||
} else {
|
||||
@@ -93,13 +93,21 @@ function updateConfiguration()
|
||||
$this->files->put($fpmConfigFile, $contents);
|
||||
|
||||
$contents = $this->files->get(__DIR__.'/../stubs/php-memory-limits.ini');
|
||||
|
||||
$destFile = dirname($fpmConfigFile);
|
||||
$destFile = str_replace('/php-fpm.d', '', $destFile);
|
||||
$destFile .= '/conf.d/php-memory-limits.ini';
|
||||
$this->files->ensureDirExists(dirname($destFile), user());
|
||||
|
||||
$this->files->putAsUser($destFile, $contents);
|
||||
|
||||
$contents = $this->files->get(__DIR__.'/../stubs/etc-phpfpm-error_log.ini');
|
||||
$contents = str_replace(['VALET_USER', 'VALET_HOME_PATH'], [user(), VALET_HOME_PATH], $contents);
|
||||
$destFile = dirname($fpmConfigFile);
|
||||
$destFile = str_replace('/php-fpm.d', '', $destFile);
|
||||
$destFile .= '/conf.d/error_log.ini';
|
||||
$this->files->ensureDirExists(dirname($destFile), user());
|
||||
$this->files->putAsUser($destFile, $contents);
|
||||
$this->files->ensureDirExists(VALET_HOME_PATH . '/Log', user());
|
||||
$this->files->touch(VALET_HOME_PATH . '/Log/php-fpm.log', user());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
5
cli/stubs/etc-phpfpm-error_log.ini
Normal file
5
cli/stubs/etc-phpfpm-error_log.ini
Normal file
@@ -0,0 +1,5 @@
|
||||
# php-fpm error logging directives
|
||||
|
||||
error_log="VALET_HOME_PATH/Log/php-fpm.log"
|
||||
log_errors=on
|
||||
log_level=debug
|
||||
@@ -13,7 +13,7 @@ listen.mode = 0777
|
||||
;php_admin_value[upload_max_filesize] = 128M
|
||||
;php_admin_value[post_max_size] = 128M
|
||||
|
||||
;php_admin_value[error_log] = VALET_HOME_PATH/Log/fpm-php.www.log
|
||||
;php_admin_value[error_log] = VALET_HOME_PATH/Log/php-fpm.log
|
||||
;php_admin_flag[log_errors] = on
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user