longestdrive's avatar

Laravel Sail set up when no php on host machine

Hi I'm trying to get Laravel Sail up and running on a new project to play around with docker as a development environment. I have docker installed and following the guidance installed a new project.

In the guidance it says to run php artisan sail:install

I don't have PHP installed on my ubuntu host machine so unable to run this command directly from the host machine.

I found some answers here which suggest to use a docker image to install the dependencies: https://laracasts.com/discuss/channels/laravel/sail-containers-on-a-computer-with-no-local-php-composer-installed I've run this command:

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/opt \
    -w /opt \
    laravelsail/php82-composer:latest \
    php artisan sail:install 

However this then generates an error:

In PhpFileParser.php line 51:
                                                                               
  File at "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/B  
  ootstrap/RegisterProviders.php" does not exist, check your classmap definit  
  ions   

So:

  1. How to initialise Sail without PHP installed on the host machine - to then run sail in a docker container
  2. If what i've done so far is the correct approach how do I overcome the error

Sail is complaining there is no configuration file if i try ./vendor/bin/sail up

Thank you

0 likes
2 replies
longestdrive's avatar

@jlrdw Thanks for the link - I've had a read of that and a lot made sense although not specific to Laravel Sail. I deleted everything and started again following this and other guides and now have Sail up an running - with teething problems but up and running! Thank you

Please or to participate in this conversation.