douwuying4709 2016-05-12 23:22
浏览 57

PHP error_log()没有写入日志 - OSX El Capitan

I'm having a beast of a time trying to get my PHP error_log() calls to actually log anything. I'm using OSX El Capitan, all the latest updates installed (I'm on 10.11.4 right now), but the error_log() calls just refuse to write anything.

Here's how I have my httpd-vhosts.conf set up:

NameVirtualHost *:80

<VirtualHost local.mysite:80>
ServerAdmin myfakeemailaddress@noneofyour.biz
DocumentRoot "/Volumes/Coding/mysite/"
ServerName local.mysite:80
<directory "/Volumes/Coding/mysite/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</directory>
php_value error_log "/Volumes/Coding/mysite/error.log"
CustomLog "/Volumes/Coding/mysite/access.log" common
</VirtualHost>

The error.log file's permissions are such that anybody in the freakin' universe can do whatever they freakin' want with it, so it's not a permissions issue.

The php.ini file confirms that the error log file is exactly where it's specified above.

I'm using CodeIgniter 3. In the config.php file, I have these lines:

$config['log_threshold'] = 4;
$config['log_path'] = '/Volumes/Coding/mysite/error.log';

The "mysite" folder also has its permissions set to allow writing.

So what else should I be checking?

  • 写回答

1条回答 默认 最新

  • dou72260 2016-05-15 02:30
    关注

    Well, this was an experience...

    Turns out that logging is off by default, and there was no php.ini to enable it. I added a php.ini that simply had this line:

    log_errors = On
    

    I threw a test error_log() into the index.php file and...it worked! However, the other error_log() commands I put in were not firing.

    After some struggling, turned out I had COMPLETELY FORGOTTEN that the code where the error_log() wasn't firing was...code that is no longer used! I forgot that I moved that functionality over to AngularJS...

    Anyway, problem solved!

    评论

报告相同问题?

悬赏问题

  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题