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

Not working valet php command to proxy calls on Macbook M3 #1490

Closed
hareom284 opened this issue Jul 21, 2024 · 7 comments
Closed

Not working valet php command to proxy calls on Macbook M3 #1490

hareom284 opened this issue Jul 21, 2024 · 7 comments
Assignees

Comments

@hareom284
Copy link

hareom284 commented Jul 21, 2024

Description

When I run the command

Valet version : 4.7.1
valet php -v or valet composer install

I am getting an error:

/opt/homebrew/bin/valet: line 158: Fatal: command not found

Steps To Reproduce

if I run the command

valet php -v or valet composer install

I am getting an error:

/opt/homebrew/bin/valet: line 158: Fatal: command not found

Diagnosis

valet php and valet composer is not working

@drbyte
Copy link
Contributor

drbyte commented Jul 21, 2024

I'm not sure what the default $PATH is on an M3, but it seems odd to me that Valet's binary executable would be put into a homebrew directory.

The error message suggests that it's not even running the specified valet script, merely reporting that it's not where it expected it to be.
To test that idea: what's the output of just running valet alone?

To help figure out what places on your PATH valet might be found, and in which order your Mac will call it:
What's the output of running which -a valet
And what's the value of PATH=.... when you run export?

@hareom284
Copy link
Author

@drbyte I configured valet correctly also working on other commands like valet link valet park valet links valet isolate ,etc ... I am just getting errors when I run valet composer install and valet php artisan tinker
Screenshot 2024-07-22 at 12 26 00 AM

@drbyte
Copy link
Contributor

drbyte commented Jul 21, 2024

For it to proxy commands, it needs access to an environment PATH that has binaries in the expected locations.

What's the output of which -a composer and which -a php ?
And what's your PATH= from running export ?

@hareom284
Copy link
Author

@drbyte These is the output.

Screenshot 2024-07-22 at 4 29 07 AM

@drbyte
Copy link
Contributor

drbyte commented Jul 23, 2024

I still think your $PATH may be wrong, but you haven't posted it.

@drbyte
Copy link
Contributor

drbyte commented Jul 23, 2024

valet php proxies via: php "~/.composer/vendor/laravel/valet/cli/valet.php" which-php --site=foo (where foo is whatever you specified).

What happens when you run it manually?
php "~/.composer/vendor/laravel/valet/cli/valet.php" which-php --site=foo
or this variant which explicitly states your home/user directory, in place of MYUSERNAME:
php "/Users/MYUSERNAME/.composer/vendor/laravel/valet/cli/valet.php" which-php --site=foo

@driesvints
Copy link
Member

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants