Closed tomasr1981 closed 6 days ago
Hello @tomasr1981, and apologies for the delay β I missed the notification π
The problem seem to be a locked version:
- league/flysystem-sftp-v3[3.0.0, ..., 3.28.0] require phpseclib/phpseclib ^3.0 -> found phpseclib/phpseclib[3.0.0, ..., 3.0.37] but the package is fixed to 2.0.47 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
You'll have to check your installed packages using composer global show --tree
, and see which other package currently locks phpseclib/phpseclib
to version 2.
Hello @dreadnaut , command which you notice return:
4.9.3 PHPloy - Incremental Git (S)FTP deployment tool that supports submodules, multiple servers and rollbacks.
βββleague/climate ^3.0
β βββphp ^7.3 || ^8.0
β βββpsr/log ^1.0 || ^2.0 || ^3.0
β β βββphp >=5.3.0
β βββseld/cli-prompt ^1.0
β βββphp >=5.3
βββleague/flysystem ^1.0
β βββext-fileinfo *
β βββleague/mime-type-detection ^1.3
β β βββext-fileinfo *
β β βββphp ^7.4 || ^8.0
β βββphp ^7.2.5 || ^8.0
βββleague/flysystem-sftp ^1.0
β βββleague/flysystem ~1.0
β β βββext-fileinfo *
β β βββleague/mime-type-detection ^1.3
β β β βββext-fileinfo *
β β β βββphp ^7.4 || ^8.0
β β βββphp ^7.2.5 || ^8.0
β βββphp >=5.6.0
β βββphpseclib/phpseclib ~2.0
β βββphp >=5.3.3
βββphp ^7.3
What can I do with it?
Seems like you still have the original PHPloy installed, which locks an old version of the SFTP library and causes the error you see
4.9.3 PHPloy - Incremental Git (S)FTP deployment tool that supports submodules, multiple servers and rollbacks.
[ ... ]
> βββleague/flysystem-sftp ^1.0
Before you install dreadnaut/phploy
, you should remove banago/phploy
(or the version that you are using). Probably something like:
composer global remove banago/phploy
If you are uncertain about the package installed, you can get the list with composer global show
.
Once you have uninstalled the old version, the command in your first message should work π
Hello @dreadnaut, great, instalation looks like good, but command phploy is unknown.
composer global require dreadnaut/phploy:dev-master
Changed current directory to /home/tomasr/.config/composer
./composer.json has been updated
Running composer update dreadnaut/phploy
Loading composer repositories with package information
Updating dependencies
Lock file operations: 12 installs, 0 updates, 0 removals
- Locking dreadnaut/phploy (dev-master 466f2bf)
- Locking league/climate (3.8.2)
- Locking league/flysystem (3.28.0)
- Locking league/flysystem-ftp (3.28.0)
- Locking league/flysystem-local (3.28.0)
- Locking league/flysystem-sftp-v3 (3.28.0)
- Locking league/mime-type-detection (1.15.0)
- Locking paragonie/constant_time_encoding (v3.0.0)
- Locking paragonie/random_compat (v9.99.100)
- Locking phpseclib/phpseclib (3.0.39)
- Locking psr/log (3.0.0)
- Locking seld/cli-prompt (1.0.4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
- Downloading paragonie/random_compat (v9.99.100)
- Downloading paragonie/constant_time_encoding (v3.0.0)
- Downloading phpseclib/phpseclib (3.0.39)
- Downloading league/flysystem (3.28.0)
- Downloading league/flysystem-local (3.28.0)
- Downloading league/flysystem-sftp-v3 (3.28.0)
- Downloading league/flysystem-ftp (3.28.0)
- Downloading dreadnaut/phploy (dev-master 466f2bf)
- Installing paragonie/random_compat (v9.99.100): Extracting archive
- Installing paragonie/constant_time_encoding (v3.0.0): Extracting archive
- Installing phpseclib/phpseclib (3.0.39): Extracting archive
- Installing league/mime-type-detection (1.15.0): Extracting archive
- Installing league/flysystem (3.28.0): Extracting archive
- Installing league/flysystem-local (3.28.0): Extracting archive
- Installing league/flysystem-sftp-v3 (3.28.0): Extracting archive
- Installing league/flysystem-ftp (3.28.0): Extracting archive
- Installing seld/cli-prompt (1.0.4): Extracting archive
- Installing psr/log (3.0.0): Extracting archive
- Installing league/climate (3.8.2): Extracting archive
- Installing dreadnaut/phploy (dev-master 466f2bf): Extracting archive
4 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.
user@computer:~$ phploy
"phploy" command not found, you may have meant:
"phploc" command from deb package phploc (7.0.2-2)
Try: sudo apt install <deb package name>
Not sure how you set up Composer, but "global" tools are usually installed in the ~/.config/composer/vendor/bin/
directory. To be able to call them directly, you need to add the path to your $PATH
shell variable.
Something like this:
export PATH=~/.composer/vendor/bin:$PATH
That line can also go in you profile script, so it's always run when you open a terminal. See if you can find a guide for your specific operating system.
After running the export
command, all Composer tools will be reachable without using the full path.
Hello @dreadnaut, I cannot manage it. No guide works for me and result is the same before and after using last command.
composer global require dreadnaut/phploy:dev-master
Changed current directory to /home/user/.config/composer
./composer.json has been updated
Running composer update dreadnaut/phploy
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.
user@computer:~$ phploy
"phploy" command not found, you may have meant:
"phploc" command from deb package phploc (7.0.2-2)
Try: sudo apt install <deb package name>
user@computer:~$ export PATH=~/.composer/vendor/bin:$PATH
user@computer:~$ phploy
"phploy" command not found, you may have meant:
"phploc" command from deb package phploc (7.0.2-2)
Try: sudo apt install <deb package name>
I think the log is giving you the correct directory when it says
Changed current directory to /home/user/.config/composer
Could you have a look in there, and see if there is a vendor/bin
directory in there, with phploy
inside? If that's the case, that's what you need to set as PATH
:
export PATH=/home/user/.config/composer/vendor/bin:$PATH
Any luck with the above βοΈ , @tomasr1981?
Hello @dreadnaut,, sorry for the late response, I was away. The phploy file is located in the directory you mention. If I start the export (in the exact wording) in the terminal, then the phploy command turns out the same as before. I hope I apply your advice correctly.
user@computer:~$ export PATH=/home/user/.config/composer/vendorbin:$PATH
user@computer:~$ phploy
"phploy" command not found, you may have meant:
"phploc" command from deb package phploc (7.0.2-2)
Try: sudo apt install <deb package name>
user@computer:~$ export PATH=/home/user/.config/composer/vendorbin:$PATH
Looks like there's a /
missing between vendor
and bin
. Should be:
export PATH=/home/user/.config/composer/vendor/bin:$PATH
Silly question, but just to be safe: are you also replacing user
with your actual username?
Hello @dreadnaut,
it was missing /
. Actual username is correct.
Now, I can call phploy
, but I have error:
PHP Fatal error: Uncaught TypeError: League\Flysystem\Ftp\FtpConnectionOptions::__construct(): Argument #5 ($port) must be of type int, string given, called in /home/user/.config/composer/vendor/league/flysystem-ftp/FtpConnectionOptions.php on line 107 and defined in /home/user/.config/composer/vendor/league/flysystem-ftp/FtpConnectionOptions.php:11
Stack trace:
#0 /home/user/.config/composer/vendor/league/flysystem-ftp/FtpConnectionOptions.php(107): League\Flysystem\Ftp\FtpConnectionOptions->__construct()
#1 /home/user/.config/composer/vendor/dreadnaut/phploy/src/Connection.php(92): League\Flysystem\Ftp\FtpConnectionOptions::fromArray()
#2 /home/user/.config/composer/vendor/dreadnaut/phploy/src/Connection.php(37): Banago\PHPloy\Connection->connectToFtp()
#3 /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php(830): Banago\PHPloy\Connection->__construct()
#4 /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php(884): Banago\PHPloy\PHPloy->connect()
#5 /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php(339): Banago\PHPloy\PHPloy->deploy()
#6 /home/user/.config/composer/vendor/dreadnaut/phploy/bin/phploy(14): Banago\PHPloy\PHPloy->__construct()
#7 /home/user/.config/composer/vendor/bin/phploy(119): include('...')
#8 {main}
thrown in /home/user/.config/composer/vendor/league/flysystem-ftp/FtpConnectionOptions.php on line 11
I remind that I use PHP 8.2
Whops, that's a bug! Thank you, should be fixed by https://github.com/dreadnaut/PHPloy/commit/e5e4c858352676ebe17e210354528a910740c909. You can get the new version with
composer global update dreadnaut/phploy
It is better, but still is fatal error there:
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, League\Flysystem\DirectoryListing given in /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php:1415
Stack trace:
#0 /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php(1415): count()
#1 /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php(952): Banago\PHPloy\PHPloy->purge()
#2 /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php(339): Banago\PHPloy\PHPloy->deploy()
#3 /home/user/.config/composer/vendor/dreadnaut/phploy/bin/phploy(14): Banago\PHPloy\PHPloy->__construct()
#4 /home/user/.config/composer/vendor/bin/phploy(119): include('...')
#5 {main}
thrown in /home/user/.config/composer/vendor/dreadnaut/phploy/src/PHPloy.php on line 1415
Neat, that something we had missed in the first clean up. Should be fixed as well π
Now it is without errors. Thanks for patient.
Thank you for your help, two bugs solved!
Hi, I installed by instructions in readme:
composer global require dreadnaut/phploy:dev-master
But it does not work: