beyondcode / invoker-community

74 stars 2 forks source link

Laravel Herd created site throws this error when using Invoker #366

Open StephenGillCoop opened 10 months ago

StephenGillCoop commented 10 months ago

I create a new site on Laravel Herd, and then load Invoker and choose the directory of the new site (Herd/newsite)


OS: darwin Invoker Version: 2.13.2 Laravel Version: unknown Local project: true PHP Binary: /usr/local/bin/php Route: /home

Error:

Error: spawn /usr/local/bin/php ENOENT
palmersoft-uk commented 9 months ago

I get this same issue as well


OS: darwin Invoker Version: 2.13.2 Laravel Version: unknown Local project: true PHP Binary: /usr/local/bin/php Route: /home?project=local-qXHN8XYqUQu5DuuF178w1A

Error:

Error: spawn /usr/local/bin/php ENOENT
rwmatthews commented 9 months ago

I also get the same error


OS: darwin Invoker Version: 2.13.2 Laravel Version: unknown Local project: true PHP Binary: /usr/local/bin/php Route: /home

Error:

Error: spawn /usr/local/bin/php ENOENT
ysrdevs commented 9 months ago

Go to Invoker Settings and correctly specify the path for the PHP binary and issue should be fixed

SolsWebdesign commented 9 months ago

For new users like me (and having a Windows laptop), the settings are at the bottom left (little gear symbol) and for getting your php path on windows: open a cmd window (in my case git bash) and enter : where php.exe Windows will answer with the full path (including the C:\ ..), just copy it and past it in the Php binary path at the top of the settings.

Palmersoft commented 9 months ago

Go to Invoker Settings and correctly specify the path for the PHP binary and issue should be fixed

@ysrdevs But isn't the point of Herd that you can have a different binary for each site potentially, depending on which version of PHP you want to use. So you would need to change the binary in invoker settings each time you change the site you are working on. If that is the case, ideally Invoker would use the Herd settings to load the relevant binary.

ysrdevs commented 9 months ago

Invoker does not read the php binary from the laravel package, it has to be pre-set. I have all projects at same php version (8.3). But if you have multiple versions of Php across different projects with dependencies that would break in newer ones version,you will have to change the binary every time I guess.

Palmersoft commented 9 months ago

Invoker does not read the php binary from the laravel package, it has to be pre-set. I have all projects at same php version (8.3). But if you have multiple versions of Php across different projects with dependencies that would break in newer ones version,you will have to change the binary every time I guess.

As both Herd and Invoker are made by BeyondCode - It is not unreasonable to assume that Invoker would be able to read the Herd config for a project folder and load the relevant binary, especially as that binary is managed and installed through Herd.