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

n31l's avatar
Level 2

laravel spark install error

The problem I'm having is with the install 'Finally add that location to your system's PATH so that the spark executable can be run from anywhere on your system.'

the spark command from terminal still isn't working and seems I'm stuck adding the Path variable correctly.

I've followed these steps and can see the following Paths inside of my .bashrc file :

in your ~/.bashrc add these lines:

export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH="$PATH:/usr/share/nginx/spark-installer"

Then reloaded:

source ~/.bashrc

Despite doing this, it's still not working.

I'm on a mac os x. Any help would be greatly appreciated !!!

0 likes
7 replies
n31l's avatar
Level 2

Fatal error: require(): Failed opening required '/usr/local/bin/../../autoload.php' (include_path='.:') in /usr/local/bin/spark on line 7

ejdelmonico's avatar

So, typing spark in the terminal shows not found? You must have the latest versions of Node and NPM as well

n31l's avatar
Level 2

Yes and I'm not too sure why, I have the latest node and NPM versions installed already

ejdelmonico's avatar

Ok, did you just install the laravel-spark installer through cloning the repo after verifying that you had the latest laravel installer?

n31l's avatar
Level 2

Yes have done that as well, Followed the steps exactly although even after cloning the repo and running composer install, the spark command was still not found

ejdelmonico's avatar
Level 53

Your path may not be correct if you are on a mac. Here is my related exports:

export PATH="$HOME/Spark-Installer:$PATH"

Hopefully, you installed the Spark installer in your home directory to make sure permissions are correct for the user.

n31l's avatar
Level 2

Thanks! that's what I needed, I realized I had that incorrect.

for me what worked was,

cd ~/

composer global require laravel/spark-installer

export PATH="$HOME/Spark-Installer:$PATH"

Please or to participate in this conversation.