1
votes

Trying to get a Laravel development environment set up on Windows 10 and am having a few issues.

The guide on the official Laravel website says it's easiest to have all the dependencies by using homestead. https://laravel.com/docs/5.2/homestead

I have Vagrant and Homestead up and running. Homestead includes Composer preinstalled. The guides I've been reading to get into Vagrant recommend using the vagrant installer through Composer. Is Composer and the vagrant installer supposed to be ran from SSHing into the Homestead Vagrant box, or is Composer and the vagrant installer supposed to be ran locally through the shared folder?

If I run this locally I run into the following issue: "Laravel New" successfully sets up a new laravel project, but before finishing warns me that there's a lot of things it recommends having installed also.

locally running 'laravel new'

symfony/var-dumper suggests installing ext-symfony_debug ()
symfony/translation suggests installing symfony/config ()
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/dependency-injection (For loading routes from a service)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/browser-kit ()
symfony/http-kernel suggests installing symfony/class-loader ()
symfony/http-kernel suggests installing symfony/config ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
league/flysystem suggests installing ext-fileinfo (Required for MimeType)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-copy (Allows you to use Copy.com storage)
league/flysystem suggests installing league/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.4).)
laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~2.0).)
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to psr7 bridging features (0.2.*).)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)

Is it normal to have this output when running 'laravel new'?

If I try to run 'laravel new' while ssh'd into the homestead box it just says

running 'laravel new' inside Homestead/vagrant

laravel: command not found

My question is..

If I'm meant to setup the Laravel with the Composer laravel installer locally, are these errors an issue? I just have Composer using a local PHP 7 install from the official PHP site - was there some other way I should've got PHP for Composer/Laravel development on W10?

If I'm meant to setup a new laravel project and use laravel installer from composer inside of Homestead, shouldn't Homestead already have Composers modules in the PATH? How would I go about adding laravel to the PATH for Composer inside the Vagrant/Homestead box if thats how it's meant to be used?

Or is the laravel installer thing with composer not how you're supposed to start a project? That was in the guide from laracasts but it just assumes Composer throws no errors and the laracasts guide doesn't use Homestead.

Thanks. Trying hard to get into this and feel ridiculous being stuck on an early step.

2
I hope somebody will help you soon. Don't feel ridiculous. I'm stuck at not being able to remove fu**ing Laravel 5 built-in Auth/Register and was feeling kinda bad until seeing this post :DVucko

2 Answers

0
votes

You must install a new laravel app after SSHing into the homestead machine. You must be getting

laravel: command not found

error as you are probably not executing

composer global require "laravel/installer"

before doing

laravel new <project_name>

Also, according to docs,

Make sure to place the ~/.composer/vendor/bin directory (or the equivalent directory for your OS) in your PATH so the laravel executable can be located by your system.

So you should place

export PATH="~/.composer/vendor/bin:$PATH" 

in your .bashrc or something.

If this fails, then try

composer create-project --prefer-dist laravel/laravel <project_name>

Refer laravel docs here for more information.

0
votes

Try to get a Laravel Development Environment through pre-installed composer

Type the following command on your command shell:

composer global require "laravel/installer=~1.1"

Then on typing which composer can get you the path: On my system it is: C:\Users\user\AppData\Roaming\Composer\vendor\bin

After getting the path, copy the path and cd into it through your command shell, then type:

laravel new project

A new Laravel development environment will be set up. You can see a new folder created once you visit that path.