我正在尝试在Ubuntu服务器上为我的应用程序设置一个简单的托pipe环境。
我创build了这样一个虚拟主机:
<VirtualHost *:80> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com DocumentRoot /home/owner/example.com/docs <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/owner/example.com/docs/> Options -Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /home/owner/example.com/logs/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /home/owner/example.com/logs/access.log combined php_flag log_errors on php_value error_log /home/owner/example.com/logs/php-error.log </VirtualHost>
现在,我的问题是,PHP的错误和警告是抛出error.log – 而不是php-error.log因为我希望。
怎么能做到这一点?
确保Apache用户有权创build/home/owner/example.com/logs/php-error.log文件,除了能够写入。
/home/owner/example.com/logs/目录很可能有755个权限,这将阻止Apache能够创buildphp-error.log文件。