Skip to content

Commit 17054e3

Browse files
author
Sumit Pore
committed
Attempt log file creation if parent directory is writable
PHP throws a warning at fopen line that it failed to open log file. This happens when program tries to create a file but parent directory is not writable. This commit adds that check before attempting creation of a file
1 parent 377c2c1 commit 17054e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

admin/partials/nginx-helper-general-options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@
647647
if ( ! is_dir( $log_path ) ) {
648648
mkdir( $log_path );
649649
}
650-
if ( ! file_exists( $log_path . 'nginx.log' ) ) {
650+
if ( is_writable( $log_path ) && ! file_exists( $log_path . 'nginx.log' ) ) {
651651
$log = fopen( $log_path . 'nginx.log', 'w' );
652652
fclose( $log );
653653
}

0 commit comments

Comments
 (0)