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

fsdolphin's avatar

Error installing Laravel 5.1 - What do I need to update, my local PHP or my Homestead box

Hi,

I got the following error when I tied to install Laravel 5.1...

Problem 1
    - This package requires php >=5.5.9 but your PHP version (5.4.10) does not satisfy that requirement.
Problem 2
    - laravel/framework v5.1.2 requires php >=5.5.9 -> your PHP version (5.4.10) does not satisfy that requirement.
    - laravel/framework v5.1.1 requires php >=5.5.9 -> your PHP version (5.4.10) does not satisfy that requirement.
 - laravel/framework v5.1.0 requires php >=5.5.9 -> your PHP version (5.4.10) does not satisfy that requirement.
    - laravel/framework 5.1.x-dev requires php >=5.5.9 -> your PHP version (5.4.10) does not satisfy that requirement.
    - Installation request for laravel/framework 5.1.* -> satisfiable by laravel/framework[5.1.x-dev, v5.1.0, v5.1.1, v5.1.2].

I went and update my Homestead Box and this is what I see when I type php -v

This is what I get when I type php -v in my local machine

PHP 5.4.10 (cli) (built: Jan 21 2013 15:12:32)      
...

and this is what I see when I type php -v in my virtual box

PHP 5.6.7-1+deb.sury.org~utopic+1 (cli) (built: Mar 24 2015 11:23:10)  
...

Do I need to update the PHP in my local machine? I was under the impression that Homestead uses the PHP version installed in the virtual box.

Why am I getting this message?

0 likes
12 replies
fsdolphin's avatar

@mstnorris
Ok, but can you elaborate a little bit as to why do I need my local PHP updated? Again I was under the impression that since I'm using Vagrant/Homestead Box it would use whatever version installed there, no?

mstnorris's avatar

@fsdolphin Well did you run the composer command from your Mac, or form within your Homestead box?

If you run it from your Mac, it is going to check the version of PHP (as it assumes nothing about Homestead, it doesn't know that you have it installed).

If on the other hand you are SSH'd into Homestead, and you run the composer command, then of course it is going to check Homestead's version of PHP - which will be >= 5.5.9.

1 like
fsdolphin's avatar

@mstnorris On my Mac inside my local environment. Ok, if I understand this correctly since I'm using composer commands from my local the PHP version in my local matters correct?

Can I install Laravel inside the virtual box and have it sync with my local environment?

1 like
mstnorris's avatar

Yes, as mentioned above, if you are running it on your host machine (in your case a Mac) then the version of PHP is checked as it needs to meet the composer.json requirements.

Can I install Laravel inside the virtual box and have it sync with my local environment?

Why do that? If you don't want to use the installed and update your Mac's PHP then just use the composer command to create a project:

composer create-project laravel/laravel --prefer-dist
1 like
fsdolphin's avatar

To answer my own question, yes it works, if you create your project in your virtual box it will show in your local immediately.

@mstnorris Well, that's the command I have been using composer create-project laravel/laravel projectName and it's how I got the error.

I will update my local version.

Thanks a lot for all of your help.

mstnorris's avatar
Level 55

I know, I mean use that command within Homestead. Don't worry about the laravel new ... helper.

Personally, I'd just update the version of PHP on your Mac, much easier to do and gives you the benefits of not having to worry about where you run the commands from.

Hope that clears it up for you.

1 like
fsdolphin's avatar

Thanks a lot for all of your help, you are awesome!.

1 like
daniel_pan's avatar

Hi, I am a Mac user and updated to the latest version of PHP And In my terminal, I run php -v It shows my PHP version is 5.5.27 But when I install Laravel via composer, I still getting the error, saying my php version is wrong (5.4) Please help.

mstnorris's avatar

What is your $PATH? Also, please open a new question rather than re-opening an older thread.

Please or to participate in this conversation.