I have read many posts on this subject and found no satisfying answer.
I am creating a file on the server via a PHP script. The file is
created using GD (imagejpeg()), though I don't think it is specific to
GD.
Here is what I understand so far:
1) a PHP script runs in the webserver user space. In my case, this is
'apache', though I think 'nobody' is quite frequent also.
2) creating a file from the script makes the "current" user its owner;
in this
case, it is also 'apache'
3) for a reason I don't get, this file will get a permission rx-------
4) using ftp solves the problem
Now, this is a problem to me. I need to create a file which will have
the same owner as if I uploaded it by ftp. IIUC, I cannot use GD with
ftp. More generally, I would prefer to avoir ftp.
The server is running in safe mode, it may cause additional problems I
am not aware of.
chmod and chown are disabled.
Therefore, I need a way to create a file (specifically with GD) which
*I* will own, as if I uploaded it by ftp.
This is getting quite urgent so a quick answer would be appreciated,
though I understand my time is not more valuable than yours.
Thank you,
Jonathan
I am creating a file on the server via a PHP script. The file is
created using GD (imagejpeg()), though I don't think it is specific to
GD.
Here is what I understand so far:
1) a PHP script runs in the webserver user space. In my case, this is
'apache', though I think 'nobody' is quite frequent also.
2) creating a file from the script makes the "current" user its owner;
in this
case, it is also 'apache'
3) for a reason I don't get, this file will get a permission rx-------
4) using ftp solves the problem
Now, this is a problem to me. I need to create a file which will have
the same owner as if I uploaded it by ftp. IIUC, I cannot use GD with
ftp. More generally, I would prefer to avoir ftp.
The server is running in safe mode, it may cause additional problems I
am not aware of.
chmod and chown are disabled.
Therefore, I need a way to create a file (specifically with GD) which
*I* will own, as if I uploaded it by ftp.
This is getting quite urgent so a quick answer would be appreciated,
though I understand my time is not more valuable than yours.
Thank you,
Jonathan
Comment