简体   繁体   中英

php error_log syslog not working

I'm experiencing some issues with following package:

[alexus@j ~]$ pkg info php56
php56-5.6.12
Name           : php56
Version        : 5.6.12
Installed on   : Thu Aug 20 08:57:22 EDT 2015
Origin         : lang/php56
Architecture   : freebsd:9:x86:64
Prefix         : /usr/local
Categories     : www lang devel
Licenses       : PHP301
Maintainer     : ale@FreeBSD.org
WWW            : http://www.php.net/
Comment        : PHP Scripting Language
Options        :
    CGI            : on
    CLI            : on
    DEBUG          : off
    DTRACE         : off
    EMBED          : off
    FPM            : on
    IPV6           : on
    LINKTHR        : on
    MAILHEAD       : off
    PHPDBG         : off
    ZTS            : off
Shared Libs required:
    libxml2.so.2
    libpcre.so.1
    libiconv.so.2
Annotations    :
    cpe            : cpe:2.3:a:php:php:5.6.12:::::freebsd9:x64
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 16.8MiB
Description    :
PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open
Source general-purpose scripting language that is especially suited for
Web development and can be embedded into HTML.  Its syntax draws upon C,
Java, and Perl, and is easy to learn.  The main goal of the language is to
allow web developers to write dynamically generated webpages quickly, but
you can do much more with PHP.

WWW: http://www.php.net/
[alexus@j ~]$ 

I'm trying to figure out what's going on and even though I just encounter Server error (500) , I don't see any being logged error_log .

[alexus@j ~]$ php -i | grep ^error_log
error_log => syslog => syslog
[alexus@j ~]$ 

I do get same output via phpinfo(); as well.

I was able to get some logging via Log Files - Apache HTTP Server Version 2.4 , but that still doesn't explain why am I not getting it via php .

What am I missing?

First step, make sure the correct value is in the correct php.ini . Modern versions of PHP use a different file for each SAPI , so you running php -i doesn't necessarily show what the settings are for Apache SAPI.

Next step would be to get a test page with only

<?php
phpinfo();
?>

in it, and access it through the web server to confirm the Apache SAPI is using the expected settings.

Personally, I prefer dumping to a file like /var/log/httpd/php_log so it's easier to see PHP errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM