|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59880 ssh2_sftp_chmod - missing function
Submitted: 2011-08-02 15:15 UTC Modified: 2012-06-17 20:55 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: sts at tradebyte dot biz Assigned: langemeijer (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.3.3 OS: Linux (Debian/squeeze)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sts at tradebyte dot biz
New email:
PHP Version: OS:


 [2011-08-02 15:15 UTC] sts at tradebyte dot biz
PHP's chmod function doesn't work on remote files, i.e. calls like chmod("ssh2.sftp:// ...")  do NOT work.

Besides there is no function like ssh2_sftp_chmod which would allow to chmod files via SFTP directly.

The provided patch adds a new PHP function "ssh2_sftp_chmod" which uses libssh2's libssh2_sftp_stat_ex to achieve that.

Function signature is:

bool ssh2_sftp_chmod(resource $sftp, string $dirname, int $mode)

Returns true on success, false on error.


Reproduce code:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-17 20:53 UTC]
Automatic comment from SVN on behalf of langemeijer
Log: Added feature ssh2_sftp_chmod() - closes bug #59880
 [2012-06-17 20:55 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: langemeijer
 [2012-06-17 20:55 UTC]
Your patch made SVN almost unmodified. Thank you!
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 10:01:26 2023 UTC