類似的問題在php error_log not working已經被問過了,但那不是我的問題。
我的phpinfo();/code>顯示
Directive Local Value Master Value
error_log /var/opt/remi/php74/log/php-pm/www-error. log /var/opt/remi/php74/log/php-fpm/www-error.log
max_execution_time 456 456
我嘗試將位置改為/var/log/php-fpm/www-error.log,但是位置總是停留在/var/opt/remi/php74/log/php-fpm/www-error.log,不管我怎么做
$ cat /etc/php.d/impng.ini
max_execution_time = 456
error_log = /var/log/php-fpm/www-error.log
我運行systemctl restart httpd / systemctl restart php74-php-fpm數次
我沒有看到檔案/var/opt/remi/php74/log/php-fpm/www-error.log被配置在任何地方:
$ grep php_admin_value /etc/httpd/conf/*
$ grep php_admin_value /etc/httpd/conf.d/*
$ grep php_admin_value /etc/httpd/conf.modules.d/*.
$ grep php_admin_value /etc/php.d/*
$ grep error_log /etc/php.d/*.
/etc/php.d/impng.ini:error_log = /var/log/php-pm/www-error.log
$ grep ErrorLog /etc/httpd/conf/*.
/etc/httpd/conf/httpd.conf:# ErrorLog。錯誤日志檔案的位置。
/etc/httpd/conf/httpd.conf:# 如果你沒有在<VirtualHost>中指定ErrorLog指令。
/etc/httpd/conf/httpd.conf:ErrorLog "logs/error_log"
$ grep ErrorLog /etc/httpd/conf.d/*.
/etc/httpd/conf.d/ssl.conf:ErrorLog logs/ssl_error_log
$ grep ErrorLog /etc/httpd/conf.modules.d/*
注意,錯誤會被正確寫入/var/opt/remi/php74/log/php-fpm/www-error.log。用error_log("test", 3, "/var/log/php-fpm/www-error.log");手動記錄也在作業。
但是我沒有辦法改變error_log的位置。其他的引數(例如:max_execution_time)被正確地考慮到了。
這是一個小問題,我可以創建符號鏈接或簡單地讀取檔案/var/opt/remi/php74/log/php-pm/www-error.log。然而,我想知道為什么我不能改變它。
uj5u.com熱心網友回復:
哪一個發行版/版本?
在Fedora和RHEL / CentOS 8中,PHP是通過php-fpm服務執行的。 而日志是在池的組態檔中配置的。
# cat /etc/opt/remi/php74/php-pm.d/www.conf
...
Default值:除了php.ini中的值和,沒有任何東西是由default定義。
;在啟動時用-d引數指定
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/opt/remi/php74/log/php-pm/www-error.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 128M
; 設定以下資料路徑為FPM行程用戶擁有的目錄。
;
; Do not change the ownership of existing system directories, if the process
用戶沒有寫入權限,請創建專用目錄用于此
;目的。
;
; 參見關于在你的系統上選擇這些目錄的位置的警告
; 在 http://php.net/session.save-path上。
php_value[session.save_handler] = files
php_value[session.save_path] = /var/opt/remi/php74/lib/php/session
php_value[soap.wsdl_cache_dir] = /var/opt/remi/php74/lib/php/wsdlcache
;php_value[opcache.file_cache] = /var/opt/remi/php74/lib/php/opcache
;php_value[opcache.preload] = /var/www/html/preload/preload.php
;php_value[opcache.preload_user] = apache
必須在spool檔案中進行配置,因為每個池可能在不同的用戶下運行,所以每個池需要自己的檔案。
提示:你可以使用:
看到一個軟體包提供的組態檔。# rpm --query --configfiles php74-php-fpm
/etc/httpd/conf.d/php74-php.conf
/etc/logrotate.d/php74-php-fpm
/etc/opt/remi/php74/php-fpm.conf
/etc/opt/remi/php74/php-fpm.d/www.conf
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/309774.html
標籤:
