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

JimmiMoller's avatar

Laravel valet 2.0 php 5.6

Is it possible to run laravel valet as php 5.6? I can see that i have to brew link php71 in order to do a valet start as it will give php errors if not. ("Fatal error: Default value for parameters with a class type hint can only be NULL in /Users/x/.composer/vendor/symfony/console/Application.php on line 83"

I need to use php 5.6 as it is an old project (and will be too time consuming and expensive for the business right now to update)

I have tried to just brew unlink php71 and brew link php56 - but then it gives the error mentioned above.

I have tried the answer from this thread: https://laracasts.com/discuss/channels/laravel/valet-custom-driver-with-other-php-version But it looks like it is not using caddy, and I cant find anything nginx with fastcgi_pass so I can change that.

0 likes
7 replies
bobbybouwmann's avatar

I think you can get around that if you use al older version of valet. Note that the thread you mention is over a year old.

What kind of project is this? If it's a Laravel project you can simply run php artisan serve and you only need to setup a database locally to make it work.

1 like
JimmiMoller's avatar

Oh yes, I probably could do that - thank you. Is it easy to change version?

And it is an old magento webshop for work. I use laravel and valet for personal projects. So when I needed a development environment for work I thought of valet, as it is (usually) easy to use.

bobbybouwmann's avatar

Well you need to install valet again from scratch, probably remove the other once first. A specific version can be pulled from composer.

composer global require laravel/valet <my-needed-version>

I believe this version should work

composer global require laravel/valet "2.0.4"

Other versions: https://github.com/laravel/valet/releases

JimmiMoller's avatar

It seems like the other components from composer still requires php 7 on 2.0.4: PHP Fatal error: Default value for parameters with a class type hint can only be NULL in /Users/jimmi/.composer/vendor/symfony/console/Application.php on line 83

Please or to participate in this conversation.