Re: [PHP] ftp_put and ftp_chmod does not work

2006-10-11 Thread Chris


When safe mode is enabled, PHP checks whether the files or directories you 
are about to operate on have the same UID (owner) as the script that is 
being executed. In addition, you cannot set the SUID, SGID and sticky 
bits.


It means that the UID (owner) of the folder ought to be the apache user or 
the ftp user?


Whoever owns the php script (which would be the ftp user).

They need to match exactly (same user, same group).

You can relax safe-mode to check the same groups 
(http://www.php.net/manual/en/features.safe-mode.php#ini.safe-mode-gid) 
rather than the same user  group but that's up to the server admin / host.


move_uploaded_file will always fail because the file isn't uploaded 
through a form. The documentation makes this rather clear (see also 
is_uploaded_file).


The file realy was uploaded by a form and it is in the temporary upload 
folder of php.


I misunderstood then.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ftp_put and ftp_chmod does not work

2006-10-10 Thread Jo�o C�ndido de Souza Neto

Chris [EMAIL PROTECTED] escreveu na mensagem 
news:[EMAIL PROTECTED]
 João Cândido de Souza Neto wrote:
 Hello everyone.

 I have got some parts of my system where some files are sent and i use 
 ftp functions to save suche files.

 When i run it in my local machine, it works fine but, when it is on the 
 server i got some errors.

 I was using ftp_put to copy such files from upload_temp folder of php to 
 my system own folder and it does not work, i thought it could be because 
 the ftp user has no permission in upload_temp folder of php.

 Most likely. ftp users are usually locked in to their own home folders and 
 can't access any other parts of the system. It's simply a security thing.

I agree.



 Then i tried to use php_chmod to give permissions for the apache user, 
 move_uploaded_files to move such file and ftp_chmod agais to remove 
 permissions. It does not work too, i think it is because the server has 
 safe_mode on.

 chmod will be affected by safe mode (please read the documentation):

 When safe mode is enabled, PHP checks whether the files or directories you 
 are about to operate on have the same UID (owner) as the script that is 
 being executed. In addition, you cannot set the SUID, SGID and sticky 
 bits.

It means that the UID (owner) of the folder ought to be the apache user or 
the ftp user?



 move_uploaded_file will always fail because the file isn't uploaded 
 through a form. The documentation makes this rather clear (see also 
 is_uploaded_file).

The file realy was uploaded by a form and it is in the temporary upload 
folder of php.



 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ftp_put and ftp_chmod does not work

2006-10-09 Thread Chris

João Cândido de Souza Neto wrote:

Hello everyone.

I have got some parts of my system where some files are sent and i use ftp 
functions to save suche files.


When i run it in my local machine, it works fine but, when it is on the 
server i got some errors.


I was using ftp_put to copy such files from upload_temp folder of php to my 
system own folder and it does not work, i thought it could be because the 
ftp user has no permission in upload_temp folder of php.


Most likely. ftp users are usually locked in to their own home folders 
and can't access any other parts of the system. It's simply a security 
thing.



Then i tried to use php_chmod to give permissions for the apache user, 
move_uploaded_files to move such file and ftp_chmod agais to remove 
permissions. It does not work too, i think it is because the server has 
safe_mode on.


chmod will be affected by safe mode (please read the documentation):

When safe mode is enabled, PHP checks whether the files or directories 
you are about to operate on have the same UID (owner) as the script that 
is being executed. In addition, you cannot set the SUID, SGID and sticky 
bits.



move_uploaded_file will always fail because the file isn't uploaded 
through a form. The documentation makes this rather clear (see also 
is_uploaded_file).


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] ftp_put and ftp_chmod does not work

2006-10-06 Thread Jo�o C�ndido de Souza Neto
Hello everyone.

I have got some parts of my system where some files are sent and i use ftp 
functions to save suche files.

When i run it in my local machine, it works fine but, when it is on the 
server i got some errors.

I was using ftp_put to copy such files from upload_temp folder of php to my 
system own folder and it does not work, i thought it could be because the 
ftp user has no permission in upload_temp folder of php.

Then i tried to use php_chmod to give permissions for the apache user, 
move_uploaded_files to move such file and ftp_chmod agais to remove 
permissions. It does not work too, i think it is because the server has 
safe_mode on.

Someone know what can i do to upload these files?

Best regards.


-- 
João Cândido de Souza Neto
Curitiba Online
[EMAIL PROTECTED]
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ftp_put and ftp_chmod does not work

2006-10-06 Thread Richard Lynch
On Fri, October 6, 2006 3:32 pm, João Cândido de Souza Neto wrote:
 when it is on
 the
 server i got some errors.

If you tell us what errors, you change the problem from an infinitely
large set of what could go wrong, to a rather small set of what
probably went wrong...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ftp_put and ftp_chmod does not work

2006-10-06 Thread Jo�o C�ndido de Souza Neto
In both case the functions just returns false.

Richard Lynch [EMAIL PROTECTED] escreveu na mensagem 
news:[EMAIL PROTECTED]
 On Fri, October 6, 2006 3:32 pm, João Cândido de Souza Neto wrote:
 when it is on
 the
 server i got some errors.

 If you tell us what errors, you change the problem from an infinitely
 large set of what could go wrong, to a rather small set of what
 probably went wrong...

 -- 
 Some people have a gift link here.
 Know what I want?
 I want you to buy a CD from some starving artist.
 http://cdbaby.com/browse/from/lynch
 Yeah, I get a buck. So? 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php