Valet-plus: Bug: Switching to and from 7.2 to 7.3 requires me to switch icu4c version

Created on 12 Sep 2019  ·  22Comments  ·  Source: weprovide/valet-plus

When I try to switch to 7.3 (valet use 7.3) PHP isn't usable. I have to run brew switch icu4c 64.2 to make it work again. And then when switching back to 7.2 I have to run brew switch icu4c 63.1.

This is what happens...

$ valet use 7.3

[[email protected]] Unlinking
Unlinking /usr/local/Cellar/[email protected]/7.2.13... 25 symlinks removed

[libjpeg] Relinking
[[email protected]] Linking
Linking /usr/local/Cellar/[email protected]/7.3.9_2... 25 symlinks created

[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[BREW TAP] henkrehorst/php already installed

In Process.php line 434:

  The process has been signaled with signal "6".  


use [<service>] [<targetVersion>]

So then I do the following to fix it...

$ brew switch icu4c 64.2

Cleaning /usr/local/Cellar/icu4c/64.2
Cleaning /usr/local/Cellar/icu4c/63.1
Opt link created for /usr/local/Cellar/icu4c/64.2

$ php -v

PHP 7.3.9 (cli) (built: Sep  9 2019 13:05:01) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.9, Copyright (c) 1999-2018, by Zend Technologies

How can I prevent this error when switching versions?

Bug

Most helpful comment

@franciskim I understand what you are saying, and thanks for your 2 cents. You see, on this day perhaps I was just caught on an off day, and agree with your sentiment of the term 'useless' but the flip side of the coin also remains you see. I could have come to this thread, and saw a fix, and commented something like "mate, you're a lifesaver" and it's Yinyang so again, I'll say that, I wasn't trying to offend anyone, the coins just fell with heads down on that comment from me, and where it fell, and how it fell, is perfectly ok. We don't all have to be super nice everyday too you know...anyways, I didn't come here to be super evil or anything like that - so I hope no feelings got hurt, and we dust ourselves off and carry on

All 22 comments

Hold up! Is 7.3 even supported at present?

I am trying to upgrade too currently to 7.3 and having issues!

Are you here any chance by Vapor requiring 7.3?

Are you here any chance by Vapor requiring 7.3?

haha, yes! I wanted to get a Laravel 6.0 project running so I could try it out :-)

Hey All,

I am not sure why your 7.2 instance is requires an old version of icu4c but my guess is it's an old PHP installation. You might want to run brew upgrade valet-php@<your-version> before trying the other commands.

I haven't seen this error before. I am also not running Laravel 6.0 in any project. Please bear with me while I try to determine the cause of the failed switch.

Could you guys show me the output of brew tap henkrehorst/php & brew install [email protected], brew link [email protected] && brew unlink [email protected], brew link [email protected] && brew unlink [email protected]

I upgraded 7.1, 7.2 and 7.3, however I now get a different error when trying to switch, as follows...

PHP Warning:  Module 'apcu' already loaded in Unknown on line 0
PHP Warning:  Module 'apcu' already loaded in Unknown on line 0
PHP Parse error:  syntax error, unexpected 'apcu' (T_STRING), expecting ')' in Command line code on line 2
PHP Warning:  Module 'apcu' already loaded in Unknown on line 0
PHP Warning:  Module 'apcu' already loaded in Unknown on line 0
PHP Parse error:  syntax error, unexpected 'apcu' (T_STRING), expecting ')' in Command line code on line 2
PHP Warning:  Module 'apcu' already loaded in Unknown on line 0

Warning: Module 'apcu' already loaded in Unknown on line 0
Could not open input file: 
Warning: Module 'apcu' already loaded in Unknown on line 0

Parse error: syntax error, unexpected 'apcu' (T_STRING), expecting ')' in Command line code on line 2/cli/valet.php

I tried that and it looked promising, however it kept putting the extension references back into php.ini when I switched version.

Should I be trying to use Valet Plus 2.0?

Mine did that too, I did have to start the machine for some of the changes to take effect.

I switched over to 2.0, had to change the minimum stability of global composer to dev

hahahah my install is royally screwed now, LOL. It's trying to reinstall the apc extension and can't, so get a nice big red bunch of errors.

Sounds like I need to try version 2

I know the feeling. Mine kept getting worse and worse. I had more luck with 2

Version 2 has been installed, ran valet install and valet fix.

Still trying to install APC?!!

Glenns-MBP:.composer glenn$ valet use 7.3
[[email protected]] Unlinking
Unlinking /usr/local/Cellar/[email protected]/7.1.32_2... 344 symlinks removed

[libjpeg] Relinking
[[email protected]] Linking
Linking /usr/local/Cellar/[email protected]/7.3.9_2... 140 symlinks created

[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[BREW TAP] henkrehorst/php already installed
[PECL] Updating PECL channel: pecl.php.net
[PECL] Installing extensions
PHP Warning:  file_get_contents(PHP Warning:  Module 'apcu' already loaded in Unknown on line 0Warning: Module 'apcu' already loaded in Unknown on line 0/usr/local/etc/valet-php/7.3/php.ini): failed to open stream: No such file or directory in /Users/glenn/.composer/vendor/weprovide/valet-plus/cli/Valet/Filesystem.php on line 112

Warning: file_get_contents(PHP Warning:  Module 'apcu' already loaded in Unknown on line 0Warning: Module 'apcu' already loaded in Unknown on line 0/usr/local/etc/valet-php/7.3/php.ini): failed to open stream: No such file or directory in /Users/glenn/.composer/vendor/weprovide/valet-plus/cli/Valet/Filesystem.php on line 112

In Pecl.php line 154:

  Could not find ini definition for: apcu in PHP Warning:  Module 'apcu' already loaded in Unknown on line 0Warning: Module 'apcu' already loaded in Unknown on line 0/usr/local/etc/valet-php/7.3/  
  php.ini                                                                                                                                                                                            


use [<service>] [<targetVersion>]

what does the start of /usr/local/etc/valet-php/7.3/php.ini look like?

extension_dir = "/usr/local/lib/php/pecl/20180731"
extension="apcu.so"
extension="geoip.so"
extension="yaml.so"
extension="apcu.so"
extension="apc.so"

The APC entries keep being put back in. I'm a bit stuck now

And having removed it manually, I get the following error on my app

Fatal error: Uncaught Error: Call to undefined function apcu_fetch() in /Users/glenn/.composer/vendor/weprovide/valet-plus/server.php:51

@glennjacobs I assume we solved this for you or are you still experiencing issues?

All sorted now thank you.

All sorted now thank you.

@glennjacobs please add how you fixed it, for other people viewing this thread. All sorted now, is literally useless.

here is what has worked for me

I ran
brew install [email protected]

Which threw errors like
general permission denied errors AND

Error: An exception occurred within a child process:
  Errno::EPERM: Operation not permitted @ apply2files - /usr/local/etc/openldap/slapd.ldif

I then ran,

chown -R YOUR_USERNAME:Admin /usr/local/Cellar

I checked to make sure I have the below in my .zshrc file

# Valet +
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/sbin:$PATH"

I then issued the command,

valet use 7.3

and received errors as below

❯❯❯ valet use 7.3
Password:
[[email protected]] Unlinking
Unlinking /usr/local/Cellar/[email protected]/7.1.26... 25 symlinks removed

[libjpeg] Relinking
[[email protected]] Linking
Linking /usr/local/Cellar/[email protected]/7.3.11_3... 25 symlinks created

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc

[[email protected]] Stopping
[[email protected]] Stopping
[[email protected]] Stopping
[BREW TAP] henkrehorst/php already installed
[PECL] Updating PECL channel: pecl.php.net
[PECL] Installing extensions
PHP Warning:  file_get_contents(PHP Warning:  Module 'apcu' already loaded in Unknown on line 0Warning: Module 'apcu' already loaded in Unknown on line 0/usr/local/etc/valet-php/7.3/php.ini): failed to open stream: No such file or directory in /Users/Username/.composer/vendor/weprovide/valet-plus/cli/Valet/Filesystem.php on line 112

Warning: file_get_contents(PHP Warning:  Module 'apcu' already loaded in Unknown on line 0Warning: Module 'apcu' already loaded in Unknown on line 0/usr/local/etc/valet-php/7.3/php.ini): failed to open stream: No such file or directory in /Users/username/.composer/vendor/weprovide/valet-plus/cli/Valet/Filesystem.php on line 112

In Pecl.php line 153:

  Could not find ini definition for: apcu_bc in PHP Warning:  Module 'apcu' already loaded in Unknown on line 0Warning: Module 'apcu' already loaded in Unknown on line 0
  /usr/local/etc/valet-php/7.3/php.ini


use [<phpVersion>]

I then removed extension="apcu.so" from /usr/local/etc/valet-php/7.3/php.ini

And then executed valet restart
and finally, after this, I issued

valet use 7.3
and at this point valet told me

Already on this version

Hope this helps,

All sorted now thank you.

@glennjacobs please add how you fixed it, for other people viewing this thread. All sorted now, is literally useless.

@WinstonN I didn't fix it, @Neodork assisted me and TBH I'm not sure what the solution was as it took many hours, over multiple days and lots of going around in circles and overcoming many other issues (some already known). As @Neodork is one of the authors of Valet+, I assume he would have shared the solution if possible and if he saw value in it.

I would say though, your reply was rather impolite. Rather than encouraging me to try help, it just got my back up. Let's try be more friendly online, it makes work much more enjoyable.

@glennjacobs please don't take my statement personally, nothing against you. I was also not trying to be polite at all, I meant what I said. I'm sure we can both agree that "all sorted now" is rather useless for other people in the same situation no?

@WinstonN if you'll allow me to share my 2 cents as someone who's having a similar issue - 'useless' - I tend to interpret as a very strong, negative emotive word. I agree:

All sorted now thank you.

...is not at all helpful for someone like me. But I personally think you could have dropped the 2nd sentence to reduce the chance of making it sound hostile.

@franciskim I understand what you are saying, and thanks for your 2 cents. You see, on this day perhaps I was just caught on an off day, and agree with your sentiment of the term 'useless' but the flip side of the coin also remains you see. I could have come to this thread, and saw a fix, and commented something like "mate, you're a lifesaver" and it's Yinyang so again, I'll say that, I wasn't trying to offend anyone, the coins just fell with heads down on that comment from me, and where it fell, and how it fell, is perfectly ok. We don't all have to be super nice everyday too you know...anyways, I didn't come here to be super evil or anything like that - so I hope no feelings got hurt, and we dust ourselves off and carry on

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wowcut picture wowcut  ·  15Comments

mike-hendriks picture mike-hendriks  ·  25Comments

rav-redchamps picture rav-redchamps  ·  13Comments

regularlabs picture regularlabs  ·  19Comments

luukschakenraad picture luukschakenraad  ·  14Comments