Problem/Motivation
PHPStan command failed:
/opt/plesk/php/7.4/bin /var/www/vhosts/mysite.com/newsite/vendor/bin/phpstan analyse --memory-limit=-1 --error-format=json --configuration=/var/www/vhosts/mysite.com/tmp/upgrade_status/deprecation_testing.neon /var/www/vhosts/mysite.com/newsite/web/modules/custom/tabedit
Command output: Empty.
Command error:
sh: /opt/plesk/php/7.4/bin: Is a directory sh: line 0: exec: /opt/plesk/php/7.4/bin: cannot execute: Is a directory
Steps to reproduce
I know this has been gone over because I read most of the issues related to it. Did I miss how this has been fixed because I have three modules showing this.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork upgrade_status-3245521
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
wxman commentedI don't know if it makes any difference, but if I manually scan any modules, the error shows up.
Comment #3
wxman commentedDoes anyone have anything they can tell me to fix this? I need to move the sites to a new server so I can do the D9 upgrades and I want to get everything working before the move.
Comment #4
pedrocorse commentedHello,
I have the same problem for all my modules except the error is sh: line 1: /usr/bin: Is a directory sh: line 1: exec: /usr/bin: cannot execute: Is a directory
Did you find a solution ?
example of error
PHPStan command failed:
/usr/bin /var/www/clients/client0/web1/web/vendor/bin/phpstan analyse --memory-limit=-1 --error-format=json --configuration=sites/default/files/tmp/upgrade_status/deprecation_testing.neon /var/www/clients/client0/web1/web/modules/advagg
Command output:
Empty.
Command error:
sh: line 1: /usr/bin: Is a directory sh: line 1: exec: /usr/bin: cannot execute: Is a directory
Comment #5
gábor hojtsyRetitling for your specific problem.
Comment #6
pedrocorse commentedHello,
thank you for changing the title but does anyone have a solution for me?
Comment #7
mglamanI'm looking into this now.
Comment #8
mglamanBased on the error output, it looks like this section of the code is being returned:
But for some reason `$php` is not getting the appropriate string concatenated. Actually, when reading any of the code I do not know how just a directory could be returned.
Comment #9
mglamanOkay, I have found a relevant item based on Laravel https://stackoverflow.com/questions/66983562/laravel-php-artisan-serve-t...
They had to set the PHP_BINARY environment variable themselves
However, Drupal doesn't use
.envfiles.I still don't understand how this can be happening.
Comment #10
mglamanComment #12
mglamanOkay, I made an MR with this change:
If the PhpExecutableFinder returns a directory we try to append
/phpas the binary path. This matches the workaround in #3241362-18: open_basedir restrictions prevent scanning to find PHP binaryComment #13
gábor hojtsyAh nice find! Asking the folks who experienced this problem to please test this!
Comment #14
gábor hojtsyComment #15
gábor hojtsyAdded a further piece to check for is_readable() so we can cover better for open_basedir. Also made error messages more specific. Still needs manual testing by those who experience the issue.
Comment #16
anybodyJust ran into this issue with upgrade_status 4.0.0 on a plesk hosted website with php 8.1. So I tried the patch.
open_basedir is configured in plesk as:
{WEBSPACEROOT}{/}{:}{TMP}{/}Error before:
Installed the patch
Cleared caches and reloaded
/admin/reports/upgrade-statusError afterwards is the same:
My current workaround is similar to change the open_basedir to:
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}opt{/}plesk{/}php{/}8.1{/}bin{/}I wrote a blog post about the workaround, if it helps someone: https://julian.pustkuchen.com/en/run-drupal-8-upgrade-status-module-ples...
So sadly my manual testing says, this doesn't work - at least in our case. Nor it changes the error message.
Any ideas?