Valet-plus: Valet plus broken after switching to any version

Created on 4 Oct 2018  路  25Comments  路  Source: weprovide/valet-plus

I reinstalled Macos on my macbook pro a few days ago. Since then I tried to install valet-plus. It works fine, but when I try to switch php version it crashes, the error is different for various php versions.

It works on php 7.1

On php 7.2 I get the following error:
Fatal error: Uncaught Error: Call to undefined function apcu_fetch() in /Users/mikehendriks/.composer/vendor/weprovide/valet-plus/server.php:37 Stack trace: #0 {main} thrown in /Users/mike/.composer/vendor/weprovide/valet-plus/server.php on line 37

On php 5.6 I get the following error:
502 Bad Gateway
nginx/1.15.5

Fortunately I don't need php 7.2 right now, but I do really need 5.6, I hope someone can help me, I've tried everything.

1.0.x

Most helpful comment

For person who switched to php5.6 and got crash with Mojave

Commenting everything out in /usr/local/etc/php/5.6/conf.d/ext-opcache.ini or removing the file solved this.

All 25 comments

For me, just on php5.6 I get 502 bad gateway.

Getting this as well

Fresh install of valet plus on mojave

Can confirm tried reinstalling valet fresh and getting 502 bad gateway with 5.6 on Mojave.

I also encounter this problem after using "$ valet use 5.6" when trying to switch back:
$ valet use 7.1
/Users/naitaes/.composer/vendor/bin/valet: line 60: 38993 Segmentation fault: 11 php "$DIR/cli/valet.php" "$@"

Same here, mac OS Mojave, 7.0+ work, 5.6 :

In Brew.php line 134:
Brew was unable to install [[email protected]].
use []

Then needs to brew uninstall [email protected] but it's not a proper fix...

We are also unable to use php 5.6 on Mojave, is this a know issue?

I've heard that re-installing brew might help, however, we haven't switched over to Mojave yet.

I've tried using a clean brew install, clean valet+ and even a clean macOS install, this did not have any effect.

Same here :(

Had the same issues, this worked for me:

brew unlink php && brew link php
brew services restart --all
composer global update
valet start

Thanks to: https://github.com/laravel/valet/issues/533#issuecomment-372088369

Tried the suggestion @Steekvlam89 gave. Can confirm this does not fix this problem

I should have a test device available this week - Mojave issue is currently our top priority!

Just fell into the same trap while switching from 7.2 to 5.6 on Mojave. Also, I'm having problems with valet.sock getting stuck on the previous version.

The socket problem should resolve itself when restarting your computer.

Yes, that is true. As a quick and dirty fix also deleting the valet.sock helps.

The bigger problem is this:
/usr/local/bin/valet: line 60: 56971 Segmentation fault: 11 php "$DIR/cli/valet.php" "$@"

Same issue for me. Seems to have broken composer as well.

composer global update

[1] 4429 segmentation fault composer global update

This issue still happens after trying the latest release (1.0.23).

Same problem.

  • Uninstalled valet plus via this -> https://gist.github.com/dannygsmith/5b74ba708d7bf8621c1cb6b959ece99f/
  • installed again
  • after installing i uninstalled and then reinstalled php7.0 e php5.6 with brew (seems like the 7.0 and 5.6 installation by valet are missing some config files under /usr/local/etc/php/...)
  • after that 7.0 missing some extension, copied from the beginning of 7.1 php.ini.

After these steps valet use working without errors, 7.0 and 7.1 ok, 5.6 still bad gateway error.

For person who switched to php5.6 and got crash with Mojave

Commenting everything out in /usr/local/etc/php/5.6/conf.d/ext-opcache.ini or removing the file solved this.

@vincent2090311 This worked for me!

@vincent2090311 same here, solved 5.6 :) now fully switching between php versions without problems. thanks for sharing

For me, this only resolves the issue after a restart every time I want to switch. But it's working!

This problem still persists on MacOS Mojave 10.14.2 with release 1.0.25 @ Jan 21st 2019.

But with the remark of @vincent2090311 it is solved if you comment out the line zend_extension="/usr/local/opt/[email protected]/lib/php/20131226/opcache.so" in /usr/local/etc/valet-php/5.6/conf.d/ext-opcache.ini. Now I am able to switch to PHP5.6 again!

EDIT: it says that it switched versions and relinked, but php -v keeps showing PHP 7.2.13 (cli) (built: Jan 13 2019 07:27:25) ( NTS ). So still no PHP version switching possible

@pvgennip If brew says it linked and your switching returns the previous PHP version. You might want to restart your entire terminal and/or machine.

Dear Contributor,

With the release of Valet+ 2.0.0 the Valet+ development team and contributors have implemented the contribution guidelines. The contribution guidelines aim to improve the support and workflow of Valet+. For further information why this was implemented please check https://github.com/weprovide/valet-plus/issues/393.

We're closing this ticket because it does not follow the correct format. If you feel your ticket is still relevant we encourage you to re-open your ticket using the correct format.

Kind regards,
The Valet+ team

hey everyone suffering from this bug :)

I experienced the same issue tonight - I actually downgraded from php 7.3 to php 7.2 (i think I also added newrelic to php 7.2 before - which could be a cause of the issue) but - long story short, look at the file /usr/local/etc/valet-php/7.2/php-fpm.d/www.conf for me the value of listen = was not a socket but a ip:port (127.0.0.1:9001)
I simply replaced another version I had working (7.3) with this one, rebooted my laptop, and it worked

In short I did

cp /usr/local/etc/valet-php/7.3/php-fpm.d/www.conf /usr/local/etc/valet-php/7.2/php-fpm.d/www.conf

Then rebooted my laptop and voillah!
I hope this helps :)

Was this page helpful?
0 / 5 - 0 ratings