Languages :: PHP :: chmod via ftp |
|||
| By: PHP newbee |
Date: 05/02/2003 00:00:00 |
Points: 200 | Status: Answered Quality : Excellent |
|
hi, i tried to change the right for a via ftp created directory also via an ftp command. i tried the following: ftp_exec($conn_id, "SITE CHMOD 713 direcoty"); and ftp_exec($conn_id, "CHMOD 713 direcoty"); i'm getting a warning that the ftp_exec() is not recognized. i cannot use the usual chmod() command because then the rights will be changed for the user "www" or "nobody" or whatever as owner... so maybe some of you have expirience with an php command to chmod a directory via ftp. THANKS!! |
|||
| By: VGR | Date: 06/02/2003 07:33:00 | Type : Answer |
|
| it means that ftp_exec() function is not available in your server. It wasn't compiled with it. Anyway, I don't fond ftp_exec() in my PHP documentation 8-))))) Table of Contents ftp_connect -- Opens up an FTP connection ftp_login -- Logs in an FTP connection ftp_pwd -- Returns the current directory name ftp_cdup -- Changes to the parent directory ftp_chdir -- Changes directories on a FTP server ftp_mkdir -- Creates a directory ftp_rmdir -- Removes a directory ftp_nlist -- Returns a list of files in the given directory. ftp_rawlist -- Returns a detailed list of files in the given directory. ftp_systype -- Returns the system type identifier of the remote FTP server. ftp_pasv -- Turns passive mode on or off. ftp_get -- Downloads a file from the FTP server. ftp_fget -- Downloads a file from the FTP server and saves to an open file. ftp_put -- Uploads a file to the FTP server. ftp_fput -- Uploads from an open file to the FTP server. ftp_size -- Returns the size of the given file. ftp_mdtm -- Returns the last modified time of the given file. ftp_rename -- Renames a file on the ftp server. ftp_delete -- Deletes a file on the ftp server. ftp_site -- Sends a SITE command to the server. ftp_quit -- Closes an FTP connection I think it should be ftp_site("chmod 713 directory") but you clearly depend on the distant FTP server's ability to process that command. I think it will not work on all the server's of the world Good luck. |
|||
| By: RQuadling | Date: 07/02/2003 22:46:00 | Type : Assist |
|
| $upload = ftp_put($conn_id, "/home/to/public_html/index.php", $source_file, FTP_ASCII); $ch=@ftp_site($conn_id,"chmod 755 /home/to/public_html/index.php"); As VGR says, but note the the return value from ftp_site is a boolean. So you have to try the command and see if it worked. Not great. Richard. |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








