Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command "about" returned error "Error: proc_open(): posix_spawn() failed: No such file or directory" if composer.phar is present #51820

Closed
poldixd opened this issue Jun 17, 2024 · 4 comments · Fixed by #51926
Assignees
Labels

Comments

@poldixd
Copy link

poldixd commented Jun 17, 2024

Laravel Version

11.10.0

PHP Version

8.3.8

Database Driver & Version

No response

Description

If the file "composer.phar" is located in the root directory of the project, the error "Error: proc_open(): posix_spawn() failed: No such file or directory" is displayed when the command "php artisan about" is executed.

However, this error is only displayed if symfony/process version >7.1 is installed. If version 7.0.x is installed, there are no problems.

If I delete the "composer.phar", everything works properly again.

Steps To Reproduce

I have created a repo on github with a new Laravel and a composer.phar: https://github.com/poldixd/laravel-composer-phar-issue/actions/runs/9548444149/job/26315645555

@poldixd
Copy link
Author

poldixd commented Jun 17, 2024

I think the problem is related to the following change in symfony/process: symfony/symfony#52409

The command is now given to proc_open as an array. If I create a string from the array using implode(' ', $commandline), everything works as usual again.

Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@EmanuelRiosRoque
Copy link

The error you're encountering seems to be related to the interaction between composer.phar and the symfony/process component in the newer version. This issue might be related to how proc_open is handled in the newer versions of symfony/process.

Here are a few steps you can try to troubleshoot and potentially resolve the issue:

Check for Open Issues: Verify if this issue has been reported in the Laravel or Symfony repositories. It might be a known issue with a patch or workaround.

Upgrade/Downgrade Symfony/Process: You've already identified that version 7.0.x works without issues. You might want to stick with this version temporarily until a fix is released. To do this, you can explicitly require this version in your composer.json:

"require": { "symfony/process": "7.0.*" }

composer update

@jduan00
Copy link

jduan00 commented Jun 20, 2024

Glad this has been filed before with temp fix. We have noticed by using v11.07, no issues.

crynobone added a commit that referenced this issue Jun 27, 2024
Introduced in symfony/symfony#52409 we no longer
should use `Illuminate\Support\ProcessUtils::escapeArgument()` unless
calling `Process` via `Process::fromShellCommandline()`

fixes #51820

Signed-off-by: Mior Muhammad Zaki <[email protected]>
@crynobone crynobone added bug and removed help wanted labels Jun 27, 2024
xuchunyang added a commit to xuchunyang/llm that referenced this issue Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants