php-ssh icon indicating copy to clipboard operation
php-ssh copied to clipboard

cast ssh resource into int to be compliant with php >=7.0

Open paulandrieux opened this issue 8 years ago • 1 comments

With php >=7.0, I have the following error when I try to create a directory to a sftp server:

The directory 'my_dir' does not exist and could not be created. at /my_project/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/Sftp.php:209)"}

The gaufrette adapter fails because of the Ssh\Sftp:getUrl() method returning an url like ssh2.sftp://Resource id #324/my_dir, which is incompatible in php >=7.0.

The following bug describe my issue: https://bugs.php.net/bug.php?id=73561

It is solvable by casting the resource into int before inject it in the url.

paulandrieux avatar Dec 08 '17 16:12 paulandrieux

Duplicate of #60 (And #62, #63)

IanSimpson avatar Feb 19 '20 18:02 IanSimpson