Re: FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory.

2017-08-01 Thread Martijn van Duren
; chroot? If I were to guess, I would bet that php is trying to create a
>> file after chrooting itself, and inside the chroot, /var/www/tmp doesn't
>> exist. Try setting those env vars to /tmp and see if that works. 
>>
>> Todd
>>
>> On Tue, Jul 25, 2017 at 09:03:38AM +0200, Stephane HUC "PengouinBSD" wrote:
>>> Hi all.
>>>
>>> I have this error on my,OpenBSD server (6.1) :
>>>
>>> FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Unable to
>>> create temporary file, Check permissions in temporary files directory.
>>> in Unknown on line 0
>>>
>>> I use nginx+php70_fpm !
>>>
>>> The php-fpm.conf for the instance:
>>>
>>>  file ***
>>> [blog.stephane-huc.net]
>>> prefix = /var/www
>>>
>>> user = user_blog
>>> group = www
>>>
>>> listen.owner = www
>>> listen.group = www
>>> listen.mode = 0660
>>>
>>> listen = run/php-fpm.$pool.sock
>>> listen.allowed_clients = 127.0.0.1
>>>
>>> chroot = $prefix
>>> chdir = /
>>>
>>> env[HOSTNAME] = $HOSTNAME
>>> ;env[PATH] = /usr/local/bin:/usr/bin:/bin
>>> env[TMP] = /var/www/tmp
>>> env[TMPDIR] = /var/www/tmp
>>> env[TEMP] = /var/www/tmp
>>>
>>> php_admin_value[upload_tmp_dir] = /tmp
>>> php_admin_value[upload_max_filesize] = 8M
>>> *** EOF ***
>>>
>>> Rights on /var/www/tmp:
>>>
>>> $ ls -al /var/www/
>>>
>>>
>>> total 68
>>> drwxr-xr-x  17 root  daemon   512 Jul  5 04:59 ./
>>> drwxr-xr-x  25 root  wheel512 Jul  5 19:50 ../
>>> drwxr-xr-x  10 www   daemon   512 Jul  9 10:31 .ht/
>>> drwxr-xr-x  11 root  daemon   512 Jul  9 10:31 acme/
>>> drwxr-xr-x   2 root  daemon   512 Jun 25 13:51 bin/
>>> drwx-T  16 www   daemon   512 Jul  9 10:31 cache/
>>> drwxr-xr-x   2 root  daemon   512 Apr  1 21:38 cgi-bin/
>>> drwxr-xr-x  10 root  daemon   512 Jul  9 10:31 conf/
>>> drwxr-xr-x   3 root  daemon   512 Jun 25 13:48 etc/
>>> drwxr-xr-x  12 root  daemon   512 Jul  9 10:29 htdocs/
>>> drwxr-xr-x   2 root  daemon   512 Jun 24 22:59 html/
>>> drwxr-xr-x  11 root  daemon  1024 Jul 23 00:00 logs/
>>> drwxr-xr-x   2 root  daemon   512 Jun 28 18:11 modules/
>>> drwxr-xr-x  11 root  daemon  1024 Jul 25 08:39 run/
>>> drwxr-xr-x  10 www   www 2048 Jul  9 10:31 tmp/
>>> drwxr-xr-x   3 root  daemon   512 Jun 24 20:44 usr/
>>> drwxr-xr-x   3 root  daemon   512 Jun 24 21:17 var/
>>>
>>>
>>> where is the problem?
>>>
>>>
>>> -- 
>>> ~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<
>>> 
>>> Stephane HUC as PengouinBSD or CIOTBSD
>>> b...@stephane-huc.net
>>>
>>
>>
> 



Re: FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory.

2017-07-26 Thread Stephane HUC "PengouinBSD"
Hi, all.

Sorry for the latence!

Yes, i'm sure all ENV* variables are absolute to the system root.
As explain on the php-fpm.conf, only few directives are relative to be
chroot.

[quote]
(...)
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr/local) applies instead.
; Note: This directive can also be relative to the global prefix.
(...)
[/quote]

I modified the php-fpm.conf_user as:

env[TMP] = /var/www/tmp/$pool
env[TMPDIR] = /var/www/tmp/$pool
env[TEMP] = /var/www/tmp/$pool
(...)
php_admin_value[upload_tmp_dir]=/tmp/$pool

I created the directory /var/www/tmp/$pool, and chowned user_blog:www on
this!

In facts, i was wrong user.

Now, it's run correctly! ;)

Thank you all.


Le 07/26/17 à 01:50, Todd Mortimer a écrit :
> Hi Stephane,
> 
> Are you sure that the env[TMP], env[TMPDIR] and env[TEMP] variables are
> supposed to be relative to the real system root, or relative to the
> chroot? If I were to guess, I would bet that php is trying to create a
> file after chrooting itself, and inside the chroot, /var/www/tmp doesn't
> exist. Try setting those env vars to /tmp and see if that works. 
> 
> Todd
> 
> On Tue, Jul 25, 2017 at 09:03:38AM +0200, Stephane HUC "PengouinBSD" wrote:
>> Hi all.
>>
>> I have this error on my,OpenBSD server (6.1) :
>>
>> FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Unable to
>> create temporary file, Check permissions in temporary files directory.
>> in Unknown on line 0
>>
>> I use nginx+php70_fpm !
>>
>> The php-fpm.conf for the instance:
>>
>>  file ***
>> [blog.stephane-huc.net]
>> prefix = /var/www
>>
>> user = user_blog
>> group = www
>>
>> listen.owner = www
>> listen.group = www
>> listen.mode = 0660
>>
>> listen = run/php-fpm.$pool.sock
>> listen.allowed_clients = 127.0.0.1
>>
>> chroot = $prefix
>> chdir = /
>>
>> env[HOSTNAME] = $HOSTNAME
>> ;env[PATH] = /usr/local/bin:/usr/bin:/bin
>> env[TMP] = /var/www/tmp
>> env[TMPDIR] = /var/www/tmp
>> env[TEMP] = /var/www/tmp
>>
>> php_admin_value[upload_tmp_dir] = /tmp
>> php_admin_value[upload_max_filesize] = 8M
>> *** EOF ***
>>
>> Rights on /var/www/tmp:
>>
>> $ ls -al /var/www/
>>
>>
>> total 68
>> drwxr-xr-x  17 root  daemon   512 Jul  5 04:59 ./
>> drwxr-xr-x  25 root  wheel512 Jul  5 19:50 ../
>> drwxr-xr-x  10 www   daemon   512 Jul  9 10:31 .ht/
>> drwxr-xr-x  11 root  daemon   512 Jul  9 10:31 acme/
>> drwxr-xr-x   2 root  daemon   512 Jun 25 13:51 bin/
>> drwx-T  16 www   daemon   512 Jul  9 10:31 cache/
>> drwxr-xr-x   2 root  daemon   512 Apr  1 21:38 cgi-bin/
>> drwxr-xr-x  10 root  daemon   512 Jul  9 10:31 conf/
>> drwxr-xr-x   3 root  daemon   512 Jun 25 13:48 etc/
>> drwxr-xr-x  12 root  daemon   512 Jul  9 10:29 htdocs/
>> drwxr-xr-x   2 root  daemon   512 Jun 24 22:59 html/
>> drwxr-xr-x  11 root  daemon  1024 Jul 23 00:00 logs/
>> drwxr-xr-x   2 root  daemon   512 Jun 28 18:11 modules/
>> drwxr-xr-x  11 root  daemon  1024 Jul 25 08:39 run/
>> drwxr-xr-x  10 www   www 2048 Jul  9 10:31 tmp/
>> drwxr-xr-x   3 root  daemon   512 Jun 24 20:44 usr/
>> drwxr-xr-x   3 root  daemon   512 Jun 24 21:17 var/
>>
>>
>> where is the problem?
>>
>>
>> -- 
>> ~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD "  +=<<<
>> 
>> Stephane HUC as PengouinBSD or CIOTBSD
>> b...@stephane-huc.net
>>
> 
> 

-- 
~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<

Stephane HUC as PengouinBSD or CIOTBSD
b...@stephane-huc.net



signature.asc
Description: OpenPGP digital signature


Re: FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory.

2017-07-25 Thread Todd Mortimer
Hi Stephane,

Are you sure that the env[TMP], env[TMPDIR] and env[TEMP] variables are
supposed to be relative to the real system root, or relative to the
chroot? If I were to guess, I would bet that php is trying to create a
file after chrooting itself, and inside the chroot, /var/www/tmp doesn't
exist. Try setting those env vars to /tmp and see if that works. 

Todd

On Tue, Jul 25, 2017 at 09:03:38AM +0200, Stephane HUC "PengouinBSD" wrote:
> Hi all.
> 
> I have this error on my,OpenBSD server (6.1) :
> 
> FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Unable to
> create temporary file, Check permissions in temporary files directory.
> in Unknown on line 0
> 
> I use nginx+php70_fpm !
> 
> The php-fpm.conf for the instance:
> 
>  file ***
> [blog.stephane-huc.net]
> prefix = /var/www
> 
> user = user_blog
> group = www
> 
> listen.owner = www
> listen.group = www
> listen.mode = 0660
> 
> listen = run/php-fpm.$pool.sock
> listen.allowed_clients = 127.0.0.1
> 
> chroot = $prefix
> chdir = /
> 
> env[HOSTNAME] = $HOSTNAME
> ;env[PATH] = /usr/local/bin:/usr/bin:/bin
> env[TMP] = /var/www/tmp
> env[TMPDIR] = /var/www/tmp
> env[TEMP] = /var/www/tmp
> 
> php_admin_value[upload_tmp_dir] = /tmp
> php_admin_value[upload_max_filesize] = 8M
> *** EOF ***
> 
> Rights on /var/www/tmp:
> 
> $ ls -al /var/www/
> 
> 
> total 68
> drwxr-xr-x  17 root  daemon   512 Jul  5 04:59 ./
> drwxr-xr-x  25 root  wheel512 Jul  5 19:50 ../
> drwxr-xr-x  10 www   daemon   512 Jul  9 10:31 .ht/
> drwxr-xr-x  11 root  daemon   512 Jul  9 10:31 acme/
> drwxr-xr-x   2 root  daemon   512 Jun 25 13:51 bin/
> drwx-T  16 www   daemon   512 Jul  9 10:31 cache/
> drwxr-xr-x   2 root  daemon   512 Apr  1 21:38 cgi-bin/
> drwxr-xr-x  10 root  daemon   512 Jul  9 10:31 conf/
> drwxr-xr-x   3 root  daemon   512 Jun 25 13:48 etc/
> drwxr-xr-x  12 root  daemon   512 Jul  9 10:29 htdocs/
> drwxr-xr-x   2 root  daemon   512 Jun 24 22:59 html/
> drwxr-xr-x  11 root  daemon  1024 Jul 23 00:00 logs/
> drwxr-xr-x   2 root  daemon   512 Jun 28 18:11 modules/
> drwxr-xr-x  11 root  daemon  1024 Jul 25 08:39 run/
> drwxr-xr-x  10 www   www 2048 Jul  9 10:31 tmp/
> drwxr-xr-x   3 root  daemon   512 Jun 24 20:44 usr/
> drwxr-xr-x   3 root  daemon   512 Jun 24 21:17 var/
> 
> 
> where is the problem?
> 
> 
> -- 
> ~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD "   +=<<<
> 
> Stephane HUC as PengouinBSD or CIOTBSD
> b...@stephane-huc.net
> 




Re: FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory.

2017-07-25 Thread Johannes Paasila
On 25 July 2017 5:03:38 pm AEST, "Stephane HUC "PengouinBSD"" 
 wrote:
>Hi all.
>
>I have this error on my,OpenBSD server (6.1) :
>
>FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Unable to
>create temporary file, Check permissions in temporary files directory.
>in Unknown on line 0
>
>I use nginx+php70_fpm !
>
>The php-fpm.conf for the instance:
>
> file ***
>[blog.stephane-huc.net]
>prefix = /var/www
>
>user = user_blog
>group = www
>
>listen.owner = www
>listen.group = www
>listen.mode = 0660
>
>listen = run/php-fpm.$pool.sock
>listen.allowed_clients = 127.0.0.1
>
>chroot = $prefix
>chdir = /
>
>env[HOSTNAME] = $HOSTNAME
>;env[PATH] = /usr/local/bin:/usr/bin:/bin
>env[TMP] = /var/www/tmp
>env[TMPDIR] = /var/www/tmp
>env[TEMP] = /var/www/tmp
>
>php_admin_value[upload_tmp_dir] = /tmp
>php_admin_value[upload_max_filesize] = 8M
>*** EOF ***
>
>Rights on /var/www/tmp:
>
>$ ls -al /var/www/
>
>
>total 68
>drwxr-xr-x  17 root  daemon   512 Jul  5 04:59 ./
>drwxr-xr-x  25 root  wheel512 Jul  5 19:50 ../
>drwxr-xr-x  10 www   daemon   512 Jul  9 10:31 .ht/
>drwxr-xr-x  11 root  daemon   512 Jul  9 10:31 acme/
>drwxr-xr-x   2 root  daemon   512 Jun 25 13:51 bin/
>drwx-T  16 www   daemon   512 Jul  9 10:31 cache/
>drwxr-xr-x   2 root  daemon   512 Apr  1 21:38 cgi-bin/
>drwxr-xr-x  10 root  daemon   512 Jul  9 10:31 conf/
>drwxr-xr-x   3 root  daemon   512 Jun 25 13:48 etc/
>drwxr-xr-x  12 root  daemon   512 Jul  9 10:29 htdocs/
>drwxr-xr-x   2 root  daemon   512 Jun 24 22:59 html/
>drwxr-xr-x  11 root  daemon  1024 Jul 23 00:00 logs/
>drwxr-xr-x   2 root  daemon   512 Jun 28 18:11 modules/
>drwxr-xr-x  11 root  daemon  1024 Jul 25 08:39 run/
>drwxr-xr-x  10 www   www 2048 Jul  9 10:31 tmp/
>drwxr-xr-x   3 root  daemon   512 Jun 24 20:44 usr/
>drwxr-xr-x   3 root  daemon   512 Jun 24 21:17 var/
>
>
>where is the problem?

Your tmp directory isn't group writable.



FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory.

2017-07-25 Thread Stephane HUC "PengouinBSD"
Hi all.

I have this error on my,OpenBSD server (6.1) :

FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: Unable to
create temporary file, Check permissions in temporary files directory.
in Unknown on line 0

I use nginx+php70_fpm !

The php-fpm.conf for the instance:

 file ***
[blog.stephane-huc.net]
prefix = /var/www

user = user_blog
group = www

listen.owner = www
listen.group = www
listen.mode = 0660

listen = run/php-fpm.$pool.sock
listen.allowed_clients = 127.0.0.1

chroot = $prefix
chdir = /

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

php_admin_value[upload_tmp_dir] = /tmp
php_admin_value[upload_max_filesize] = 8M
*** EOF ***

Rights on /var/www/tmp:

$ ls -al /var/www/


total 68
drwxr-xr-x  17 root  daemon   512 Jul  5 04:59 ./
drwxr-xr-x  25 root  wheel512 Jul  5 19:50 ../
drwxr-xr-x  10 www   daemon   512 Jul  9 10:31 .ht/
drwxr-xr-x  11 root  daemon   512 Jul  9 10:31 acme/
drwxr-xr-x   2 root  daemon   512 Jun 25 13:51 bin/
drwx-T  16 www   daemon   512 Jul  9 10:31 cache/
drwxr-xr-x   2 root  daemon   512 Apr  1 21:38 cgi-bin/
drwxr-xr-x  10 root  daemon   512 Jul  9 10:31 conf/
drwxr-xr-x   3 root  daemon   512 Jun 25 13:48 etc/
drwxr-xr-x  12 root  daemon   512 Jul  9 10:29 htdocs/
drwxr-xr-x   2 root  daemon   512 Jun 24 22:59 html/
drwxr-xr-x  11 root  daemon  1024 Jul 23 00:00 logs/
drwxr-xr-x   2 root  daemon   512 Jun 28 18:11 modules/
drwxr-xr-x  11 root  daemon  1024 Jul 25 08:39 run/
drwxr-xr-x  10 www   www 2048 Jul  9 10:31 tmp/
drwxr-xr-x   3 root  daemon   512 Jun 24 20:44 usr/
drwxr-xr-x   3 root  daemon   512 Jun 24 21:17 var/


where is the problem?


-- 
~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<

Stephane HUC as PengouinBSD or CIOTBSD
b...@stephane-huc.net



signature.asc
Description: OpenPGP digital signature