Welcome! Log In Create A New Profile

Advanced

Why the php-error.log is empty?

Posted by Damiano 
Damiano
Why the php-error.log is empty?
May 03, 2011 05:16AM
Hello,

I have this php-fpm.conf

[example.com]
listen = 127.0.0.1:9001
listen.owner = example.com
listen.group = example.com
listen.mode = 0660
listen.backlog = -1

user = example.com
group = example.com

pm = dynamic
pm.max_requests = 0
pm.max_children = 2
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 1

chroot = /home/vhosts/example.com/

request_terminate_timeout = 2
request_slowlog_timeout = 1
slowlog = /home/vhosts/example.com/log/php-
slow.log

catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp


php_flag[display_errors] = on
php_admin_value[session.save_path] = /tmp
php_admin_value[error_log] = /home/vhosts/example.com/
log/php-error.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 100M
php_value[max_execution_time] = 20

I don't understand why /home/vhosts/example.com/log/php-error.log is
empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
the error as output but the php-error.log still empty.

I chrooted my vhost, but If i change

/home/vhosts/example.com/log/php-error.log

to

/log/php-error.log

I get a really strange error, when I do "10 / 0"!

Fatal error: main(): Timezone database is corrupt - this should
*never* happen! in /web/index.php on line 10

Could someone help me?

Thanks
khizar sonu
Re: Why the php-error.log is empty?
May 03, 2011 05:38AM
is error log directory is exist??

On 5/3/11, Damiano <damianoporta@gmail.com> wrote:
> Hello,
>
> I have this php-fpm.conf
>
> [example.com]
> listen = 127.0.0.1:9001
> listen.owner = example.com
> listen.group = example.com
> listen.mode = 0660
> listen.backlog = -1
>
> user = example.com
> group = example.com
>
> pm = dynamic
> pm.max_requests = 0
> pm.max_children = 2
> pm.start_servers = 1
> pm.min_spare_servers = 1
> pm.max_spare_servers = 1
>
> chroot = /home/vhosts/example.com/
>
> request_terminate_timeout = 2
> request_slowlog_timeout = 1
> slowlog = /home/vhosts/example.com/log/php-
> slow.log
>
> catch_workers_output = yes
>
> env[HOSTNAME] = $HOSTNAME
> env[PATH] = /usr/local/bin:/usr/bin:/bin
> env[TMP] = /tmp
> env[TMPDIR] = /tmp
> env[TEMP] = /tmp
>
>
> php_flag[display_errors] = on
> php_admin_value[session.save_path] = /tmp
> php_admin_value[error_log] = /home/vhosts/example.com/
> log/php-error.log
> php_admin_flag[log_errors] = on
> php_admin_value[memory_limit] = 100M
> php_value[max_execution_time] = 20
>
> I don't understand why /home/vhosts/example.com/log/php-error.log is
> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
> the error as output but the php-error.log still empty.
>
> I chrooted my vhost, but If i change
>
> /home/vhosts/example.com/log/php-error.log
>
> to
>
> /log/php-error.log
>
> I get a really strange error, when I do "10 / 0"!
>
> Fatal error: main(): Timezone database is corrupt - this should
> *never* happen! in /web/index.php on line 10
>
> Could someone help me?
>
> Thanks
>
Damiano Porta
Re: Why the php-error.log is empty?
May 03, 2011 05:54AM
Sure, also the file exists.


On 03/05/2011 11:36, khizar sonu wrote:
> is error log directory is exist??
>
> On 5/3/11, Damiano<damianoporta@gmail.com> wrote:
>> Hello,
>>
>> I have this php-fpm.conf
>>
>> [example.com]
>> listen = 127.0.0.1:9001
>> listen.owner = example.com
>> listen.group = example.com
>> listen.mode = 0660
>> listen.backlog = -1
>>
>> user = example.com
>> group = example.com
>>
>> pm = dynamic
>> pm.max_requests = 0
>> pm.max_children = 2
>> pm.start_servers = 1
>> pm.min_spare_servers = 1
>> pm.max_spare_servers = 1
>>
>> chroot = /home/vhosts/example.com/
>>
>> request_terminate_timeout = 2
>> request_slowlog_timeout = 1
>> slowlog = /home/vhosts/example.com/log/php-
>> slow.log
>>
>> catch_workers_output = yes
>>
>> env[HOSTNAME] = $HOSTNAME
>> env[PATH] = /usr/local/bin:/usr/bin:/bin
>> env[TMP] = /tmp
>> env[TMPDIR] = /tmp
>> env[TEMP] = /tmp
>>
>>
>> php_flag[display_errors] = on
>> php_admin_value[session.save_path] = /tmp
>> php_admin_value[error_log] = /home/vhosts/example.com/
>> log/php-error.log
>> php_admin_flag[log_errors] = on
>> php_admin_value[memory_limit] = 100M
>> php_value[max_execution_time] = 20
>>
>> I don't understand why /home/vhosts/example.com/log/php-error.log is
>> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
>> the error as output but the php-error.log still empty.
>>
>> I chrooted my vhost, but If i change
>>
>> /home/vhosts/example.com/log/php-error.log
>>
>> to
>>
>> /log/php-error.log
>>
>> I get a really strange error, when I do "10 / 0"!
>>
>> Fatal error: main(): Timezone database is corrupt - this should
>> *never* happen! in /web/index.php on line 10
>>
>> Could someone help me?
>>
>> Thanks
>>
khizar sonu
Re: Why the php-error.log is empty?
May 03, 2011 06:04AM
add this line

log_level = notice

;;Possible Values: alert, error, warning, notice, debug

On 5/3/11, Damiano Porta <damianoporta@gmail.com> wrote:
> Sure, also the file exists.
>
>
> On 03/05/2011 11:36, khizar sonu wrote:
>> is error log directory is exist??
>>
>> On 5/3/11, Damiano<damianoporta@gmail.com> wrote:
>>> Hello,
>>>
>>> I have this php-fpm.conf
>>>
>>> [example.com]
>>> listen = 127.0.0.1:9001
>>> listen.owner = example.com
>>> listen.group = example.com
>>> listen.mode = 0660
>>> listen.backlog = -1
>>>
>>> user = example.com
>>> group = example.com
>>>
>>> pm = dynamic
>>> pm.max_requests = 0
>>> pm.max_children = 2
>>> pm.start_servers = 1
>>> pm.min_spare_servers = 1
>>> pm.max_spare_servers = 1
>>>
>>> chroot = /home/vhosts/example.com/
>>>
>>> request_terminate_timeout = 2
>>> request_slowlog_timeout = 1
>>> slowlog = /home/vhosts/example.com/log/php-
>>> slow.log
>>>
>>> catch_workers_output = yes
>>>
>>> env[HOSTNAME] = $HOSTNAME
>>> env[PATH] = /usr/local/bin:/usr/bin:/bin
>>> env[TMP] = /tmp
>>> env[TMPDIR] = /tmp
>>> env[TEMP] = /tmp
>>>
>>>
>>> php_flag[display_errors] = on
>>> php_admin_value[session.save_path] = /tmp
>>> php_admin_value[error_log] = /home/vhosts/example.com/
>>> log/php-error.log
>>> php_admin_flag[log_errors] = on
>>> php_admin_value[memory_limit] = 100M
>>> php_value[max_execution_time] = 20
>>>
>>> I don't understand why /home/vhosts/example.com/log/php-error.log is
>>> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
>>> the error as output but the php-error.log still empty.
>>>
>>> I chrooted my vhost, but If i change
>>>
>>> /home/vhosts/example.com/log/php-error.log
>>>
>>> to
>>>
>>> /log/php-error.log
>>>
>>> I get a really strange error, when I do "10 / 0"!
>>>
>>> Fatal error: main(): Timezone database is corrupt - this should
>>> *never* happen! in /web/index.php on line 10
>>>
>>> Could someone help me?
>>>
>>> Thanks
>>>
>
>
Damiano Porta
Re: Why the php-error.log is empty?
May 03, 2011 06:56AM
I already have log_level on the [global]

do I have to repeat this directive each pool ?



On 03/05/2011 12:02, khizar sonu wrote:
> add this line
>
> log_level = notice
>
> ;;Possible Values: alert, error, warning, notice, debug
>
> On 5/3/11, Damiano Porta<damianoporta@gmail.com> wrote:
>> Sure, also the file exists.
>>
>>
>> On 03/05/2011 11:36, khizar sonu wrote:
>>> is error log directory is exist??
>>>
>>> On 5/3/11, Damiano<damianoporta@gmail.com> wrote:
>>>> Hello,
>>>>
>>>> I have this php-fpm.conf
>>>>
>>>> [example.com]
>>>> listen = 127.0.0.1:9001
>>>> listen.owner = example.com
>>>> listen.group = example.com
>>>> listen.mode = 0660
>>>> listen.backlog = -1
>>>>
>>>> user = example.com
>>>> group = example.com
>>>>
>>>> pm = dynamic
>>>> pm.max_requests = 0
>>>> pm.max_children = 2
>>>> pm.start_servers = 1
>>>> pm.min_spare_servers = 1
>>>> pm.max_spare_servers = 1
>>>>
>>>> chroot = /home/vhosts/example.com/
>>>>
>>>> request_terminate_timeout = 2
>>>> request_slowlog_timeout = 1
>>>> slowlog = /home/vhosts/example.com/log/php-
>>>> slow.log
>>>>
>>>> catch_workers_output = yes
>>>>
>>>> env[HOSTNAME] = $HOSTNAME
>>>> env[PATH] = /usr/local/bin:/usr/bin:/bin
>>>> env[TMP] = /tmp
>>>> env[TMPDIR] = /tmp
>>>> env[TEMP] = /tmp
>>>>
>>>>
>>>> php_flag[display_errors] = on
>>>> php_admin_value[session.save_path] = /tmp
>>>> php_admin_value[error_log] = /home/vhosts/example.com/
>>>> log/php-error.log
>>>> php_admin_flag[log_errors] = on
>>>> php_admin_value[memory_limit] = 100M
>>>> php_value[max_execution_time] = 20
>>>>
>>>> I don't understand why /home/vhosts/example.com/log/php-error.log is
>>>> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
>>>> the error as output but the php-error.log still empty.
>>>>
>>>> I chrooted my vhost, but If i change
>>>>
>>>> /home/vhosts/example.com/log/php-error.log
>>>>
>>>> to
>>>>
>>>> /log/php-error.log
>>>>
>>>> I get a really strange error, when I do "10 / 0"!
>>>>
>>>> Fatal error: main(): Timezone database is corrupt - this should
>>>> *never* happen! in /web/index.php on line 10
>>>>
>>>> Could someone help me?
>>>>
>>>> Thanks
>>>>
>>
Călin Don
Re: Why the php-error.log is empty?
May 03, 2011 07:00AM
Check that the fpm process has proper permissions to the file (can create
files in directory and can write to log file).

On Tue, May 3, 2011 at 13:02, khizar sonu <gaadds@gmail.com> wrote:

> add this line
>
> log_level = notice
>
> ;;Possible Values: alert, error, warning, notice, debug
>
> On 5/3/11, Damiano Porta <damianoporta@gmail.com> wrote:
> > Sure, also the file exists.
> >
> >
> > On 03/05/2011 11:36, khizar sonu wrote:
> >> is error log directory is exist??
> >>
> >> On 5/3/11, Damiano<damianoporta@gmail.com> wrote:
> >>> Hello,
> >>>
> >>> I have this php-fpm.conf
> >>>
> >>> [example.com]
> >>> listen = 127.0.0.1:9001
> >>> listen.owner = example.com
> >>> listen.group = example.com
> >>> listen.mode = 0660
> >>> listen.backlog = -1
> >>>
> >>> user = example.com
> >>> group = example.com
> >>>
> >>> pm = dynamic
> >>> pm.max_requests = 0
> >>> pm.max_children = 2
> >>> pm.start_servers = 1
> >>> pm.min_spare_servers = 1
> >>> pm.max_spare_servers = 1
> >>>
> >>> chroot = /home/vhosts/example.com/
> >>>
> >>> request_terminate_timeout = 2
> >>> request_slowlog_timeout = 1
> >>> slowlog = /home/vhosts/example.com/log/php-
> >>> slow.log
> >>>
> >>> catch_workers_output = yes
> >>>
> >>> env[HOSTNAME] = $HOSTNAME
> >>> env[PATH] = /usr/local/bin:/usr/bin:/bin
> >>> env[TMP] = /tmp
> >>> env[TMPDIR] = /tmp
> >>> env[TEMP] = /tmp
> >>>
> >>>
> >>> php_flag[display_errors] = on
> >>> php_admin_value[session.save_path] = /tmp
> >>> php_admin_value[error_log] = /home/vhosts/
> example.com/
> >>> log/php-error.log
> >>> php_admin_flag[log_errors] = on
> >>> php_admin_value[memory_limit] = 100M
> >>> php_value[max_execution_time] = 20
> >>>
> >>> I don't understand why /home/vhosts/example.com/log/php-error.log is
> >>> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
> >>> the error as output but the php-error.log still empty.
> >>>
> >>> I chrooted my vhost, but If i change
> >>>
> >>> /home/vhosts/example.com/log/php-error.log
> >>>
> >>> to
> >>>
> >>> /log/php-error.log
> >>>
> >>> I get a really strange error, when I do "10 / 0"!
> >>>
> >>> Fatal error: main(): Timezone database is corrupt - this should
> >>> *never* happen! in /web/index.php on line 10
> >>>
> >>> Could someone help me?
> >>>
> >>> Thanks
> >>>
> >
> >
>
Damiano Porta
Re: Why the php-error.log is empty?
May 03, 2011 07:08AM
I think yes, because fpm has created php-error.log so i think it has the
correct permissions.


On 03/05/2011 12:55, Ca(lin Don wrote:
> Check that the fpm process has proper permissions to the file (can
> create files in directory and can write to log file).
>
> On Tue, May 3, 2011 at 13:02, khizar sonu <gaadds@gmail.com
> <mailto:gaadds@gmail.com>> wrote:
>
> add this line
>
> log_level = notice
>
> ;;Possible Values: alert, error, warning, notice, debug
>
> On 5/3/11, Damiano Porta <damianoporta@gmail.com
> <mailto:damianoporta@gmail.com>> wrote:
> > Sure, also the file exists.
> >
> >
> > On 03/05/2011 11:36, khizar sonu wrote:
> >> is error log directory is exist??
> >>
> >> On 5/3/11, Damiano<damianoporta@gmail.com
> <mailto:damianoporta@gmail.com>> wrote:
> >>> Hello,
> >>>
> >>> I have this php-fpm.conf
> >>>
> >>> [example.com http://example.com]
> >>> listen = 127.0.0.1:9001
> http://127.0.0.1:9001
> >>> listen.owner = example.com http://example.com
> >>> listen.group = example.com http://example.com
> >>> listen.mode = 0660
> >>> listen.backlog = -1
> >>>
> >>> user = example.com http://example.com
> >>> group = example.com http://example.com
> >>>
> >>> pm = dynamic
> >>> pm.max_requests = 0
> >>> pm.max_children = 2
> >>> pm.start_servers = 1
> >>> pm.min_spare_servers = 1
> >>> pm.max_spare_servers = 1
> >>>
> >>> chroot = /home/vhosts/example.com/ http://example.com/
> >>>
> >>> request_terminate_timeout = 2
> >>> request_slowlog_timeout = 1
> >>> slowlog =
> /home/vhosts/example.com/log/php- http://example.com/log/php-
> >>> slow.log
> >>>
> >>> catch_workers_output = yes
> >>>
> >>> env[HOSTNAME] = $HOSTNAME
> >>> env[PATH] = /usr/local/bin:/usr/bin:/bin
> >>> env[TMP] = /tmp
> >>> env[TMPDIR] = /tmp
> >>> env[TEMP] = /tmp
> >>>
> >>>
> >>> php_flag[display_errors] = on
> >>> php_admin_value[session.save_path] = /tmp
> >>> php_admin_value[error_log] =
> /home/vhosts/example.com/ http://example.com/
> >>> log/php-error.log
> >>> php_admin_flag[log_errors] = on
> >>> php_admin_value[memory_limit] = 100M
> >>> php_value[max_execution_time] = 20
> >>>
> >>> I don't understand why
> /home/vhosts/example.com/log/php-error.log
> http://example.com/log/php-error.log is
> >>> empty, I caused some errors like 10 / 0 (Zero division) etc
> etc, I see
> >>> the error as output but the php-error.log still empty.
> >>>
> >>> I chrooted my vhost, but If i change
> >>>
> >>> /home/vhosts/example.com/log/php-error.log
> http://example.com/log/php-error.log
> >>>
> >>> to
> >>>
> >>> /log/php-error.log
> >>>
> >>> I get a really strange error, when I do "10 / 0"!
> >>>
> >>> Fatal error: main(): Timezone database is corrupt - this should
> >>> *never* happen! in /web/index.php on line 10
> >>>
> >>> Could someone help me?
> >>>
> >>> Thanks
> >>>
> >
> >
>
>
Damiano Porta
PHP-FPM BUG ?
May 03, 2011 01:56PM
Hello,

I think I have found a *bug*.

I have this simple script:

|<?php

echo getmygid()."<br />"; //Also tried|posix_getegid()
|
echo getmypid(). "<br />";

?>
|

The output is:

|1004
16768
|

but if I check the real processes (*ps aux*) on the system I see.

|root16767 0.0 0.1 145888 4620 ? Ss 19:30 0:00 /usr/sbin/php5-fpm--fpm-config/etc/php5/fpm/main.conf
1005 16768 0.0 0.1 146804 6264 ? S19:30 0:00 /usr/sbin/php5-fpm--fpm-config/etc/php5/fpm/main.conf
1004 16769 0.0 0.1 145880 4064 ? S19:30 0:00 /usr/sbin/php5-fpm--fpm-config/etc/php5/fpm/main.conf
1006 16770 0.0 0.1 145880 4068 ? S19:30 0:00 /usr/sbin/php5-fpm--fpm-config/etc/php5/fpm/main.conf
|

As you can see getmypid() and posix_getegid() shows a different process.

1004 gid has 16769 (PID) *NOT* 16768.

Is it a BUG?


Damiano
Clark Freifeld
Re: Why the php-error.log is empty?
May 03, 2011 04:38PM
I saw this error in my own chrooted installation:

Fatal error: main(): Timezone database is corrupt - this should
*never* happen! in /web/index.php on line 10

(Thought only when using time-related PHP functions.) The solution is
to copy over your zoneinfo files into the chroot, like so:

cp -r /usr/share/zoneinfo /path/to/chroot/usr/share/

You'll probably need to be root to execute this command.

Hope that helps.
Clark

On Tue, May 3, 2011 at 7:05 AM, Damiano Porta <damianoporta@gmail.com> wrote:
> I think yes, because fpm has created php-error.log so i think it has the
> correct permissions.
>
>
> On 03/05/2011 12:55, Călin Don wrote:
>
> Check that the fpm process has proper permissions to the file (can create
> files in directory and can write to log file).
>
> On Tue, May 3, 2011 at 13:02, khizar sonu <gaadds@gmail.com> wrote:
>>
>> add this line
>>
>> log_level = notice
>>
>> ;;Possible Values: alert, error, warning, notice, debug
>>
>> On 5/3/11, Damiano Porta <damianoporta@gmail.com> wrote:
>> > Sure, also the file exists.
>> >
>> >
>> > On 03/05/2011 11:36, khizar sonu wrote:
>> >> is error log directory is exist??
>> >>
>> >> On 5/3/11, Damiano<damianoporta@gmail.com>  wrote:
>> >>> Hello,
>> >>>
>> >>> I have this php-fpm.conf
>> >>>
>> >>> [example.com]
>> >>>          listen                 = 127.0.0.1:9001
>> >>>          listen.owner           = example.com
>> >>>          listen.group           = example.com
>> >>>          listen.mode            = 0660
>> >>>          listen.backlog         = -1
>> >>>
>> >>>          user  = example.com
>> >>>          group = example.com
>> >>>
>> >>>          pm                   = dynamic
>> >>>          pm.max_requests      = 0
>> >>>          pm.max_children      = 2
>> >>>          pm.start_servers     = 1
>> >>>          pm.min_spare_servers = 1
>> >>>          pm.max_spare_servers = 1
>> >>>
>> >>>          chroot = /home/vhosts/example.com/
>> >>>
>> >>>          request_terminate_timeout = 2
>> >>>          request_slowlog_timeout   = 1
>> >>>          slowlog                   = /home/vhosts/example.com/log/php-
>> >>> slow.log
>> >>>
>> >>>          catch_workers_output = yes
>> >>>
>> >>>          env[HOSTNAME] = $HOSTNAME
>> >>>          env[PATH] = /usr/local/bin:/usr/bin:/bin
>> >>>          env[TMP] = /tmp
>> >>>          env[TMPDIR] = /tmp
>> >>>          env[TEMP] = /tmp
>> >>>
>> >>>
>> >>>          php_flag[display_errors]            = on
>> >>>          php_admin_value[session.save_path]  = /tmp
>> >>>          php_admin_value[error_log]          =
>> >>> /home/vhosts/example.com/
>> >>> log/php-error.log
>> >>>          php_admin_flag[log_errors]          = on
>> >>>          php_admin_value[memory_limit]       = 100M
>> >>>          php_value[max_execution_time]       = 20
>> >>>
>> >>> I don't understand why /home/vhosts/example.com/log/php-error.log is
>> >>> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
>> >>> the error as output but the php-error.log still empty.
>> >>>
>> >>> I chrooted my vhost, but If i change
>> >>>
>> >>> /home/vhosts/example.com/log/php-error.log
>> >>>
>> >>> to
>> >>>
>> >>> /log/php-error.log
>> >>>
>> >>> I get a really strange error, when I do "10 / 0"!
>> >>>
>> >>> Fatal error: main(): Timezone database is corrupt - this should
>> >>> *never* happen! in /web/index.php on line 10
>> >>>
>> >>> Could someone help me?
>> >>>
>> >>> Thanks
>> >>>
>> >
>> >
>
>
>
Damiano Porta
Re: Why the php-error.log is empty?
May 03, 2011 04:42PM
Yes Clark, this is the problem... How to know what directories I should
copy to run PHP correctly?




On 03/05/2011 14:15, Clark Freifeld wrote:
> I saw this error in my own chrooted installation:
>
> Fatal error: main(): Timezone database is corrupt - this should
> *never* happen! in /web/index.php on line 10
>
> (Thought only when using time-related PHP functions.) The solution is
> to copy over your zoneinfo files into the chroot, like so:
>
> cp -r /usr/share/zoneinfo /path/to/chroot/usr/share/
>
> You'll probably need to be root to execute this command.
>
> Hope that helps.
> Clark
>
> On Tue, May 3, 2011 at 7:05 AM, Damiano Porta<damianoporta@gmail.com> wrote:
>> I think yes, because fpm has created php-error.log so i think it has the
>> correct permissions.
>>
>>
>> On 03/05/2011 12:55, Călin Don wrote:
>>
>> Check that the fpm process has proper permissions to the file (can create
>> files in directory and can write to log file).
>>
>> On Tue, May 3, 2011 at 13:02, khizar sonu<gaadds@gmail.com> wrote:
>>> add this line
>>>
>>> log_level = notice
>>>
>>> ;;Possible Values: alert, error, warning, notice, debug
>>>
>>> On 5/3/11, Damiano Porta<damianoporta@gmail.com> wrote:
>>>> Sure, also the file exists.
>>>>
>>>>
>>>> On 03/05/2011 11:36, khizar sonu wrote:
>>>>> is error log directory is exist??
>>>>>
>>>>> On 5/3/11, Damiano<damianoporta@gmail.com> wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I have this php-fpm.conf
>>>>>>
>>>>>> [example.com]
>>>>>> listen = 127.0.0.1:9001
>>>>>> listen.owner = example.com
>>>>>> listen.group = example.com
>>>>>> listen.mode = 0660
>>>>>> listen.backlog = -1
>>>>>>
>>>>>> user = example.com
>>>>>> group = example.com
>>>>>>
>>>>>> pm = dynamic
>>>>>> pm.max_requests = 0
>>>>>> pm.max_children = 2
>>>>>> pm.start_servers = 1
>>>>>> pm.min_spare_servers = 1
>>>>>> pm.max_spare_servers = 1
>>>>>>
>>>>>> chroot = /home/vhosts/example.com/
>>>>>>
>>>>>> request_terminate_timeout = 2
>>>>>> request_slowlog_timeout = 1
>>>>>> slowlog = /home/vhosts/example.com/log/php-
>>>>>> slow.log
>>>>>>
>>>>>> catch_workers_output = yes
>>>>>>
>>>>>> env[HOSTNAME] = $HOSTNAME
>>>>>> env[PATH] = /usr/local/bin:/usr/bin:/bin
>>>>>> env[TMP] = /tmp
>>>>>> env[TMPDIR] = /tmp
>>>>>> env[TEMP] = /tmp
>>>>>>
>>>>>>
>>>>>> php_flag[display_errors] = on
>>>>>> php_admin_value[session.save_path] = /tmp
>>>>>> php_admin_value[error_log] =
>>>>>> /home/vhosts/example.com/
>>>>>> log/php-error.log
>>>>>> php_admin_flag[log_errors] = on
>>>>>> php_admin_value[memory_limit] = 100M
>>>>>> php_value[max_execution_time] = 20
>>>>>>
>>>>>> I don't understand why /home/vhosts/example.com/log/php-error.log is
>>>>>> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I see
>>>>>> the error as output but the php-error.log still empty.
>>>>>>
>>>>>> I chrooted my vhost, but If i change
>>>>>>
>>>>>> /home/vhosts/example.com/log/php-error.log
>>>>>>
>>>>>> to
>>>>>>
>>>>>> /log/php-error.log
>>>>>>
>>>>>> I get a really strange error, when I do "10 / 0"!
>>>>>>
>>>>>> Fatal error: main(): Timezone database is corrupt - this should
>>>>>> *never* happen! in /web/index.php on line 10
>>>>>>
>>>>>> Could someone help me?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>
>>
>>
Clark Freifeld
Re: Why the php-error.log is empty?
May 03, 2011 11:44PM
I don't know of any way to know definitively all the necessary
directories. It probably varies by what Linux distribution you are
using, making it tricky.

I used this guide to set up nginx in a chroot (I am using nginx +
php-fpm, in the same chroot):

http://www.cyberciti.biz/faq/howto-run-nginx-in-a-chroot-jail/

On Ubuntu 10.10, I found it was missing

/bin/cp -fv /lib/{libnss_compat.so.2,libnsl.so.1,libnss_nis.so.2,libnss_files.so.2}
/path/to/chroot/lib

And for php,

copying the timezone files, as well as

creating a /chroot/var/lib/php5/ and matching the permission settings
of the original /var/lib/php5 in order to get file-base session
management (the default) working.

I set the error log path in my nginx configuration and that file picks
up the error logging from php-fpm. I left the php_flag* php_admin* all
commented and set settings in /etc/php5/fpm/php.ini, seemed to work.

Clark

On Tue, May 3, 2011 at 4:39 PM, Damiano Porta <damianoporta@gmail.com> wrote:
> Yes Clark, this is the problem... How to know what directories I should copy
> to run PHP correctly?
>
>
>
>
> On 03/05/2011 14:15, Clark Freifeld wrote:
>>
>> I saw this error in my own chrooted installation:
>>
>> Fatal error: main(): Timezone database is corrupt - this should
>> *never* happen! in /web/index.php on line 10
>>
>> (Thought only when using time-related PHP functions.) The solution is
>> to copy over your zoneinfo files into the chroot, like so:
>>
>> cp -r /usr/share/zoneinfo /path/to/chroot/usr/share/
>>
>> You'll probably need to be root to execute this command.
>>
>> Hope that helps.
>> Clark
>>
>> On Tue, May 3, 2011 at 7:05 AM, Damiano Porta<damianoporta@gmail.com>
>>  wrote:
>>>
>>> I think yes, because fpm has created php-error.log so i think it has the
>>> correct permissions.
>>>
>>>
>>> On 03/05/2011 12:55, Călin Don wrote:
>>>
>>> Check that the fpm process has proper permissions to the file (can create
>>> files in directory and can write to log file).
>>>
>>> On Tue, May 3, 2011 at 13:02, khizar sonu<gaadds@gmail.com>  wrote:
>>>>
>>>> add this line
>>>>
>>>> log_level = notice
>>>>
>>>> ;;Possible Values: alert, error, warning, notice, debug
>>>>
>>>> On 5/3/11, Damiano Porta<damianoporta@gmail.com>  wrote:
>>>>>
>>>>> Sure, also the file exists.
>>>>>
>>>>>
>>>>> On 03/05/2011 11:36, khizar sonu wrote:
>>>>>>
>>>>>> is error log directory is exist??
>>>>>>
>>>>>> On 5/3/11, Damiano<damianoporta@gmail.com>    wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I have this php-fpm.conf
>>>>>>>
>>>>>>> [example.com]
>>>>>>>          listen                 = 127.0.0.1:9001
>>>>>>>          listen.owner           = example.com
>>>>>>>          listen.group           = example.com
>>>>>>>          listen.mode            = 0660
>>>>>>>          listen.backlog         = -1
>>>>>>>
>>>>>>>          user  = example.com
>>>>>>>          group = example.com
>>>>>>>
>>>>>>>          pm                   = dynamic
>>>>>>>          pm.max_requests      = 0
>>>>>>>          pm.max_children      = 2
>>>>>>>          pm.start_servers     = 1
>>>>>>>          pm.min_spare_servers = 1
>>>>>>>          pm.max_spare_servers = 1
>>>>>>>
>>>>>>>          chroot = /home/vhosts/example.com/
>>>>>>>
>>>>>>>          request_terminate_timeout = 2
>>>>>>>          request_slowlog_timeout   = 1
>>>>>>>          slowlog                   =
>>>>>>> /home/vhosts/example.com/log/php-
>>>>>>> slow.log
>>>>>>>
>>>>>>>          catch_workers_output = yes
>>>>>>>
>>>>>>>          env[HOSTNAME] = $HOSTNAME
>>>>>>>          env[PATH] = /usr/local/bin:/usr/bin:/bin
>>>>>>>          env[TMP] = /tmp
>>>>>>>          env[TMPDIR] = /tmp
>>>>>>>          env[TEMP] = /tmp
>>>>>>>
>>>>>>>
>>>>>>>          php_flag[display_errors]            = on
>>>>>>>          php_admin_value[session.save_path]  = /tmp
>>>>>>>          php_admin_value[error_log]          =
>>>>>>> /home/vhosts/example.com/
>>>>>>> log/php-error.log
>>>>>>>          php_admin_flag[log_errors]          = on
>>>>>>>          php_admin_value[memory_limit]       = 100M
>>>>>>>          php_value[max_execution_time]       = 20
>>>>>>>
>>>>>>> I don't understand why /home/vhosts/example.com/log/php-error.log is
>>>>>>> empty, I caused some errors like 10 / 0 (Zero division) etc etc, I
>>>>>>> see
>>>>>>> the error as output but the php-error.log still empty.
>>>>>>>
>>>>>>> I chrooted my vhost, but If i change
>>>>>>>
>>>>>>> /home/vhosts/example.com/log/php-error.log
>>>>>>>
>>>>>>> to
>>>>>>>
>>>>>>> /log/php-error.log
>>>>>>>
>>>>>>> I get a really strange error, when I do "10 / 0"!
>>>>>>>
>>>>>>> Fatal error: main(): Timezone database is corrupt - this should
>>>>>>> *never* happen! in /web/index.php on line 10
>>>>>>>
>>>>>>> Could someone help me?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>
>>>
>>>
>
>
Damiano Porta
Why connection refused?
May 06, 2011 01:36PM
Hello,

I found these lines on my *error.log *

2011-05-06 17:06:54: (mod_fastcgi.c.2582) unexpected end-of-file
(perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9000
2011-05-06 17:06:54: (mod_fastcgi.c.3367) response not received, request
sent: 578 on socket: tcp:127.0.0.1:9000 for /index.php?, closing connection
2011-05-06 17:06:54: (mod_fastcgi.c.2582) unexpected end-of-file
(perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9000
2011-05-06 17:06:54: (mod_fastcgi.c.3367) response not received, request
sent: 578 on socket: tcp:127.0.0.1:9000 for /index.php?, closing connection
2011-05-06 17:06:54: (mod_fastcgi.c.2582) unexpected end-of-file
(perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9000
2011-05-06 17:06:54: (mod_fastcgi.c.3367) response not received, request
sent: 578 on socket: tcp:127.0.0.1:9000 for /index.php?, closing connection
2011-05-06 17:06:55: (mod_fastcgi.c.2582) unexpected end-of-file
(perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9000
2011-05-06 17:06:55: (mod_fastcgi.c.3367) response not received, request
sent: 578 on socket: tcp:127.0.0.1:9000 for /index.php?, closing connection
2011-05-06 17:06:55: (mod_fastcgi.c.2582) unexpected end-of-file
(perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9000
2011-05-06 17:06:55: (mod_fastcgi.c.3367) response not received, request
sent: 578 on socket: tcp:127.0.0.1:9000 for /index.php?, closing connection
2011-05-06 17:07:27: (mod_fastcgi.c.2582) unexpected end-of-file
(perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9000
2011-05-06 17:07:27: (mod_fastcgi.c.3382) response already sent out, but
backend returned error on socket: tcp:127.0.0.1:9000 for /index.php?,
terminating connection
2011-05-06 17:07:30: (mod_fastcgi.c.2582) unexpected end-of-file
(perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9000
2011-05-06 17:07:30: (mod_fastcgi.c.3367) response not received, request
sent: 578 on socket: tcp:127.0.0.1:9000 for /index.php?, closing connection
2011-05-06 18:55:34: (server.c.1503) server stopped by UID = 0 PID = 7790
2011-05-06 18:55:35: (log.c.166) server started
2011-05-06 18:59:04: (mod_fastcgi.c.2916) establishing connection
failed: Connection refused socket: tcp:127.0.0.1:9002
2011-05-06 18:59:04: (mod_fastcgi.c.2922) backend is overloaded; we'll
disable it for 1 seconds and send the request to another backend
instead: reconnects: 0 load: 1
2011-05-06 18:59:04: (mod_fastcgi.c.3608) all handlers for /index.php?
on .php are down.
2011-05-06 18:59:06: (mod_fastcgi.c.2864) fcgi-server re-enabled:
tcp:127.0.0.1:9002
2011-05-06 18:59:07: (mod_fastcgi.c.2916) establishing connection
failed: Connection refused socket: tcp:127.0.0.1:9002
2011-05-06 18:59:07: (mod_fastcgi.c.2922) backend is overloaded; we'll
disable it for 1 seconds and send the request to another backend
instead: reconnects: 0 load: 1
2011-05-06 18:59:07: (mod_fastcgi.c.3608) all handlers for /index.php?
on .php are down.

.....
.....

There are a lot of connections refused. Why? I was trying the
performances of my server with the Apache benchmark command (ab)...

The is my *pool*:

[example.com]
listen = 127.0.0.1:9000
listen.owner = example.com
listen.group = example.com
listen.mode = 0660
listen.backlog = -1

user = example.com
group = example.com

pm = dynamic
pm.max_requests = 500
pm.max_children = 5
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.status_path = /status

ping.path = /ping
ping.response = pong

request_terminate_timeout = 15s
request_slowlog_timeout = 15s
slowlog =
/home/lighttpd/vhosts/example.com/log/php-slow.log

catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

;php_flag[display_errors] = on
php_admin_value[open_basedir] =
/home/lighttpd/vhosts/example.com/web
php_admin_flag[log_errors] = on
php_admin_value[error_log] =
/home/lighttpd/vhosts/example.com/log/php-error.log
;php_admin_value[memory_limit] = 32M
;php_value[max_execution_time] = 30


The processes are running correctly *ps aux*:

root 7761 0.0 0.1 145900 4672 ? Ss 18:54 0:00
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
lighttpd 7812 0.1 0.1 90924 4384 ? S 18:55 0:04
/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
1005 7905 0.0 0.1 146916 5304 ? S 19:04 0:00
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1004 7964 1.4 0.6 153320 25788 ? S 19:16 0:14
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1004 7967 1.2 0.8 160752 32960 ? S 19:16 0:11
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1006 7968 0.0 0.1 146916 5308 ? S 19:16 0:00
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1006 7969 0.0 0.1 146916 5308 ? S 19:16 0:00
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1006 7970 0.0 0.1 146916 5308 ? S 19:16 0:00
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1005 7971 0.0 0.1 146916 5308 ? S 19:16 0:00
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1004 7972 0.6 0.8 161520 34036 ? S 19:16 0:06
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf
1004 7975 0.2 0.8 161264 33164 ? S 19:16 0:02
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf


Why these connections refused?

Thank you in advance
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 181
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready