Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

danieltj's avatar

I can't install Spark, nothing works

I'm trying to install Spark and nothing is working. The install steps don't explain it well enough at all. I have a Laravel 5.4 setup in public/ which works fine if I do php artisan serve. But I'm trying to get Spark to work and I'm having no luck at all with.

So far I'm up to cloning the repository into the directory, which I've done but then the install guide says to get your path right. What does that mean?

I'm so confused - please help.

0 likes
14 replies
ejdelmonico's avatar

Spark installer installs everything you need including Laravel and Cashier. How did you install Spark exactly? If you installed via composer, then something is probably missing or the installation directory is not as expected.

Cronix's avatar

I installed Laravel first via composer, then added Spark to the project via composer (along with cashier). Everything worked just with those 2 steps (and registering the service providers). I'd suggest using composer instead of git clone. It will put things where they are supposed to be and you won't have to mess with paths.

Also which version of Spark are you installing? If you're using Laravel 5.4, you should be using the 4.x version/branch of Spark. The current 5.x branch has been updated for the changes for Laravel 5.5.

danieltj's avatar

I've setup a new Laravel site using laravel new and it's created it. The only problem though is that it said that it can't install the following due to using PHP 5.6 and needing PHP7 installed instead.

  Problem 1
    - This package requires php >=7.0.0 but your PHP version (5.6.30) does not satisfy that requirement.
  Problem 2
    - Installation request for doctrine/inflector v1.2.0 -> satisfiable by doctrine/inflector[v1.2.0].
    - doctrine/inflector v1.2.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 3
    - Installation request for laravel/framework v5.5.14 -> satisfiable by laravel/framework[v5.5.14].
    - laravel/framework v5.5.14 requires php >=7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 4
    - Installation request for swiftmailer/swiftmailer v6.0.2 -> satisfiable by swiftmailer/swiftmailer[v6.0.2].
    - swiftmailer/swiftmailer v6.0.2 requires php >=7.0.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 5
    - Installation request for phpdocumentor/reflection-docblock 4.1.1 -> satisfiable by phpdocumentor/reflection-docblock[4.1.1].
    - phpdocumentor/reflection-docblock 4.1.1 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 6
    - Installation request for phpunit/php-code-coverage 5.2.2 -> satisfiable by phpunit/php-code-coverage[5.2.2].
    - phpunit/php-code-coverage 5.2.2 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 7
    - Installation request for phpunit/php-token-stream 2.0.1 -> satisfiable by phpunit/php-token-stream[2.0.1].
    - phpunit/php-token-stream 2.0.1 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 8
    - Installation request for phpunit/phpunit 6.4.2 -> satisfiable by phpunit/phpunit[6.4.2].
    - phpunit/phpunit 6.4.2 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 9
    - Installation request for phpunit/phpunit-mock-objects 4.0.4 -> satisfiable by phpunit/phpunit-mock-objects[4.0.4].
    - phpunit/phpunit-mock-objects 4.0.4 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 10
    - Installation request for sebastian/comparator 2.0.2 -> satisfiable by sebastian/comparator[2.0.2].
    - sebastian/comparator 2.0.2 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 11
    - Installation request for sebastian/diff 2.0.1 -> satisfiable by sebastian/diff[2.0.1].
    - sebastian/diff 2.0.1 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 12
    - Installation request for sebastian/environment 3.1.0 -> satisfiable by sebastian/environment[3.1.0].
    - sebastian/environment 3.1.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 13
    - Installation request for sebastian/exporter 3.1.0 -> satisfiable by sebastian/exporter[3.1.0].
    - sebastian/exporter 3.1.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 14
    - Installation request for sebastian/global-state 2.0.0 -> satisfiable by sebastian/global-state[2.0.0].
    - sebastian/global-state 2.0.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 15
    - Installation request for sebastian/object-enumerator 3.0.3 -> satisfiable by sebastian/object-enumerator[3.0.3].
    - sebastian/object-enumerator 3.0.3 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 16
    - Installation request for sebastian/object-reflector 1.1.1 -> satisfiable by sebastian/object-reflector[1.1.1].
    - sebastian/object-reflector 1.1.1 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 17
    - Installation request for sebastian/recursion-context 3.0.0 -> satisfiable by sebastian/recursion-context[3.0.0].
    - sebastian/recursion-context 3.0.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 18
    - Installation request for theseer/tokenizer 1.1.0 -> satisfiable by theseer/tokenizer[1.1.0].
    - theseer/tokenizer 1.1.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
  Problem 19
    - laravel/framework v5.5.14 requires php >=7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
    - laravel/tinker v1.0.2 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.5.14].
    - Installation request for laravel/tinker v1.0.2 -> satisfiable by laravel/tinker[v1.0.2].

I'm using Local by Flywheel to setup the dev site (which works for Laravel 5.4 using PHP 5.6), but updating the PHP version doesn't seem to work.

danieltj's avatar

I have a fresh version of Laravel 5.5 working now - I managed to get PHP 7.1 installed properly with Homebrew so that seems to be working alright now. My only problem I'm having is trying to get Spark to work.

How can I install Spark through Composer? Is it possible?

danieltj's avatar

I've tried cloning the repository from GitHub (https://github.com/laravel/spark-installer) but haven't managed to get it to work. I don't know if my path is right but I can new use laravel new so I'm assuming that's fine.

How can I get Spark installed with Composer? Can someone help please?

Please help, I'm pulling my hair out with this.

danieltj's avatar

I'm really not sure what the difference is.

I tried getting the Spark installer to work but I couldn't figure it out. How does it work exactly? I cloned it from GitHub into my working directory but then I don't know what to do from there. I'm so confused.

I'm on macOS.

ejdelmonico's avatar

@danieltj First you should run composer global require laravel/installer. The Laravel installer must be installed before spark so,

composer global update
composer global require laravel/installer

Also, make sure you have permission to the Spark repo. Go to you home directory and run git clone https://github.com/laravel/spark-installer.git spark-installer. Then cd Spark-Installer and run composer install. After that, add the spark-installer directory to you $PATH so the command can be found.

Next, get your token from the spark dashboard and spark register token-value. You can verify the token with spark token.

To create the project, spark new your-new-project.

danieltj's avatar

@ejdelmonico the bit I don't understand is this bit:

After that, add the spark-installer directory to you $PATH so the command can be found.

I don't understand what I need to do there. At the moment my.bashrc file looks like this (this is the entire contents of it):

# Path for Composer
export PATH="$HOME/.composer/vendor/bin:$PATH"

So when I do spark inside the spark-installer folder it says -bash: spark: command not found. This is in the root folder when Documents and Downloads are on macOS ~.

I'm not sure what I should be doing at this step. The install seems to work but when I try and use the Spark command it says it's not a command so I'm completely stumped on this bit.

I'm sorry for being a pain, I just don't understand.

ejdelmonico's avatar

@danieltj Add this to your .bashrc export PATH="/Users/YOU/spark-installer:$PATH" Make sure you put your computer name in place of YOU in the path.

danieltj's avatar

@ejdelmonico I tried that but it still didn't work. I add this to bashrc:

# Path for Composer
export PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH="/Users/djames/spark-installer:$PATH"

Then I cd'd into spark-installer and tried spark help and it should command not found.

The Spark executable is here: /Users/djames/spark-installer/spark.

If I double click on the executable, I get the following popup in a new Terminal window:

$ /Users/djames/spark-installer/spark ; exit;
Laravel Spark Installer 1.2.0

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help      Displays help for a command
  list      Lists commands
  new       Create a new Spark application
  register  Register an API token with the installer
  token     Display the currently registered Spark API token
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.


[Process completed]
ejdelmonico's avatar
Level 53

@danieltj Check your permissions and ownership of the spark executable.

-rwxr-xr-x

Also, did you source your .bashrc before trying the command so that the new path variable is registered? Just close the window or open a new tab and try again.

1 like
danieltj's avatar

I made sure to do another source command and for whatever reason, it's finally started working. Thank you so much for helping @ejdelmonico!

Please or to participate in this conversation.