laravel / sanctum

Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.
https://laravel.com/docs/sanctum
MIT License
2.75k stars 296 forks source link

Fresh L11 is missing package when installing api #535

Closed khalyomede closed 1 month ago

khalyomede commented 1 month ago

Sanctum Version

4.0.2

Laravel Version

11.23.5

PHP Version

8.3.10

Database Driver & Version

No response

Description

An error occured on fresh install:

anwar@ubuntu:~/programming/project$ php artisan install:api

   Symfony\Component\Process\Exception\ProcessStartFailedException 

  The command "'composer' 'require' 'laravel/sanctum:^4.0'" failed.

Working directory: /home/alpine/app

Error: proc_open(): posix_spawn() failed: No such file or directory

  at vendor/symfony/process/Process.php:371
    367▕             restore_error_handler();
    368▕         }
    369▕ 
    370▕         if (!\is_resource($process)) {
  ➜ 371▕             throw new ProcessStartFailedException($this, $lastError);
    372▕         }
    373▕         $this->process = $process;
    374▕         $this->status = self::STATUS_STARTED;
    375▕ 

      +17 vendor frames 

  18  artisan:13
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

There seems to be some well known solution in the community, but I wonder if the suggested solution should be used or if there is a missing dependency on Sanctum side. Edit: The dependency is already included and this does not fix my issue.

https://github.com/laravel/framework/issues/51820#issuecomment-2181296114

Steps To Reproduce

With these executables (all runing inside Alpine Linux v3):

anwar@ubuntu:~/programming/project$ composer --version
Creating code-social-network_composer_run ... done
Composer version 2.7.9 2024-09-04 14:43:28
PHP version 8.3.10 (/usr/local/bin/php)
Run the "diagnose" command to get more detailed diagnostics output.

anwar@ubuntu:~/programming/project$ php --version
Creating code-social-network_php_run ... done
PHP 8.3.10 (cli) (built: Aug  1 2024 19:53:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.10, Copyright (c) Zend Technologies

Create laravel project:

anwar@ubuntu:~/programming/project$ composer create-project laravel/laravel:11.* .

Install Sanctum:

anwar@ubuntu:~/programming/project$ php artisan install:api
Creating code-social-network_php_run ... done

   Symfony\Component\Process\Exception\ProcessStartFailedException 

  The command "'composer' 'require' 'laravel/sanctum:^4.0'" failed.

Working directory: /home/alpine/app

Error: proc_open(): posix_spawn() failed: No such file or directory

  at vendor/symfony/process/Process.php:371
    367▕             restore_error_handler();
    368▕         }
    369▕ 
    370▕         if (!\is_resource($process)) {
  ➜ 371▕             throw new ProcessStartFailedException($this, $lastError);
    372▕         }
    373▕         $this->process = $process;
    374▕         $this->status = self::STATUS_STARTED;
    375▕ 

      +17 vendor frames 

  18  artisan:13
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))
crynobone commented 1 month ago

Hi there,

Can you test this again with Laravel Framework 11.24.0?

crynobone commented 1 month ago

Hey there,

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