php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25063 ftp_site docs ambiguous
Submitted: 2003-08-12 15:38 UTC Modified: 2003-08-12 16:30 UTC
From: gilem at wsg dot net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.3RC3 OS: linux
Private report: No CVE-ID: None
 [2003-08-12 15:38 UTC] gilem at wsg dot net
Description:
------------
http://us4.php.net/manual/en/function.ftp-site.php

the docs do not specify that the SITE command is not supposed to be included in the second argument.

This could be qualified with an example.

ftp_site( $conn_id, "CHMOD 755 filename" );



Reproduce code:
---------------
ftp_site( $conn_id, "SITE CHMOD 755 filename" );

fails since it sends 
SITE SITE...
to the server.



Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-12 16:30 UTC] pollita@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

I've added the following example as well as a "See Also" link to ftp_raw() which acts the way your reproduce code was expecting ftp_site() to act.


<?php
/* Connect to FTP server */
$conn = ftp_connect('ftp.example.com');
if (!$conn) die('Unable to connect to ftp.example.com');

/* Login as "user" with password "pass" */
if (!ftp_login($conn, 'user', 'pass')) die('Error logging into ftp.example.com');

/* Issue: "SITE CHMOD 0600 /home/user/privatefile" command to ftp server */
if (ftp_site($conn, 'CHMOD 0600 /home/user/privatefile')) {
   echo "Command executed successfully.\n";
} else {
   die('Command failed.');
}
?>

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 15:01:27 2024 UTC