You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running composer update downloads Chromedriver to vaimo/binary-chromedriver/downloads/chromedriver but doesn't move it to vendor/bin/chromedriver
The reason
After PHP downloads the chromedriver binary and saves it on vaimo/binary-chromedriver/downloads/chromedriver, it comes with the permission 0644, which is not executable.
Try to set executable permissions on the binary after downloading it (check if the permission is copied when moving the file as well). Let the user know if that fails.
This issue was happening to me, but not to my colleague or in CI, so I've dived deeper to find out what was the difference.
Turns out that both my colleague and CI are running Ubuntu, and they have unzip. I don't have unzip, so it unzips the package with PHP, which causes the permission to be 0644 instead of 0755.
I've installed unzip in my system, removed the chmod and it worked.
Either way, the chmod seems a good thing to have in place for those that don't have unzip installed :)
The problem
Running
composer update
downloads Chromedriver tovaimo/binary-chromedriver/downloads/chromedriver
but doesn't move it tovendor/bin/chromedriver
The reason
After PHP downloads the chromedriver binary and saves it on
vaimo/binary-chromedriver/downloads/chromedriver
, it comes with the permission 0644, which is not executable.The PackageManager only moves to
vendor/bin/chromedriver
if the file is executable: https://github.com/vaimo/webdriver-binary-downloader/blob/master/src/Managers/PackageManager.php#L111Therefore it doesn't move the file.
A proposed solution
Try to set executable permissions on the binary after downloading it (check if the permission is copied when moving the file as well). Let the user know if that fails.
Quick workaround
I've just added
chmod($this->systemUtils->composePath($sourceDir, $binary), 0754);
before line 80 in https://github.com/vaimo/webdriver-binary-downloader/blob/master/src/Managers/PackageManager.php#L80. Worked fine.Environment
The text was updated successfully, but these errors were encountered: