jalendport / switch-php

Easily switch between PHP versions on your Mac. Requires Homebrew and works with Laravel Valet. 🔀
https://www.npmjs.com/package/switch-php
MIT License
123 stars 27 forks source link

Doesn't seem to be working when switching from the latest version of PHP #15

Open moorebrett0 opened 4 years ago

moorebrett0 commented 4 years ago

Hey there!

When I try and switch from php 7.4.5, nothing seems to happen.

brett~/Sites$ switch-php 7.1
Password:
Valet stopped ✔
PHP switched ✔
Valet started ✔

You are now using PHP 7.4.5

I'd expect PHP 7.1 to be in use after running this.

eleftrik commented 4 years ago

Same here.

❯ php --version
PHP 7.4.6 (cli) (built: May 29 2020 01:44:57) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies

❯ switch-php 7.3 -v
 👀  Verifying that Valet is installed...
 🔍  Checking which PHP versions are installed...
 🔀  Switching to php@7.3...
 ==>  Stopping php@7.3...
 ==>  Unlinking php@7.3...
 ==>  Linking php@7.3...
 ==>  Starting php@7.3...
 ✅  PHP switched

You are now using PHP 7.4.6

❯ php --version
PHP 7.4.6 (cli) (built: May 29 2020 01:44:57) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies
jalendport commented 4 years ago

@eleftrik aha I know exactly what's happening to you - I'll push a fix here in a bit.

@moorebrett0 not sure why yours is doing that... 🤔 Can you try running switch-php in verbose mode and sharing that here? Maybe also give me the output of brew services list while you're at it...

eleftrik commented 4 years ago

@eleftrik aha I know exactly what's happening to you - I'll push a fix here in a bit.

@jalendport Any news about this? Thank you very much

tolu-paystack commented 4 years ago

Hi @jalendport having this same issue when trying to switch from 7.4.7 to 7.2

> switch-php 7.2 -m 1024M -v
 👀  Verifying that Valet is installed...
 🔍  Checking which PHP versions are installed...
 🔀  Switching to php@7.2...
 ==>  Stopping php@7.2...
 ==>  Unlinking php@7.2...
 ==>  Linking php@7.2...
 ==>  Starting php@7.2...
 ✅  PHP switched

You are now using PHP 7.4.7
ssssct commented 4 years ago

Same here

You are now using PHP 7.4.7
$ switch-php 7.2 -v -m 512M
 👀  Verifying that Valet is installed...
 🔍  Checking which PHP versions are installed...
 🛑  Stopping Valet...
 ==>  Stopping nginx...
 ✅  Valet stopped
 🔀  Switching to php@7.2...
 ==>  Stopping php@7.2...
 ==>  Unlinking php@7.2...
 ==>  Linking php@7.2...
 ==>  Starting php@7.2...
 ✅  PHP switched
 ⚙  Starting Valet...
 ==>  Starting nginx...
 ==>  Starting dnsmasq...
 ✅  Valet started
 🎛  Configuring PHP...
 ==>  Setting PHP memory to 512M...
 ==>  Restarting PHP...
 ✅  PHP configured

You are now using PHP 7.4.7
davideprevosto commented 4 years ago

Unfortunately I have the same issue. Thank for your support.

imtbl commented 4 years ago

Having the same issue, is there any news?

moorebrett0 commented 4 years ago

@jalendport -

Verifying that Valet is installed...
Password:
 🔍  Checking which PHP versions are installed...
 🛑  Stopping Valet...
 ==>  Stopping nginx...
 ✅  Valet stopped
 🔀  Switching to php@7.3...
 ==>  Stopping php@7.3...
 ==>  Unlinking php@7.3...
 ==>  Linking php@7.3...
 ==>  Starting php@7.3...
 ✅  PHP switched
 ⚙  Starting Valet...
 ==>  Starting nginx...
 ✅  Valet started

and brew services list:

Name      Status  User  Plist
dnsmasq   started root  /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mysql     started root  /Library/LaunchDaemons/homebrew.mxcl.mysql.plist
mysql@5.7 started root  /Library/LaunchDaemons/homebrew.mxcl.mysql@5.7.plist
nginx     started root  /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php       started root  /Library/LaunchDaemons/homebrew.mxcl.php.plist
php@7.3   started brett /Users/brett/Library/LaunchAgents/homebrew.mxcl.php@7.3.plist
eleftrik commented 4 years ago

@jalendport Just to know... Is this project dead?

joelpro2 commented 3 years ago

Kind of the same as everybody I use httpd to compile php

switch-php 7.4 -v
 👀  Verifying that Valet is installed...
 🔍  Checking which PHP versions are installed...
 🔀  Switching to php@7.4...
 ==>  Stopping php@7.2...
 ==>  Unlinking php@7.2...
 ==>  Stopping php@7.4...
 ==>  Unlinking php@7.4...
 ==>  Linking php@7.4...
 ==>  Starting php@7.4...
 ✅  PHP switched

You are now using PHP 7.2.34
brew services list
Name    Status  User Plist
httpd   started ...  ...
php     stopped      
php@7.2 stopped      
php@7.4 started ...  ...
redis   started ...  ...
joelpro2 commented 3 years ago

@jalendport Just to know... Is this project dead?

Doesn't seem so, the last issue closed was in 2019 #12 by souhaiebtar was closed on 16 Nov 2019

Preshy commented 3 years ago

same issue here

encodiaweb commented 3 years ago

@jalendport Has this project been discontinued?

moorebrett0 commented 3 years ago

@encodia I believe it has.

encodiaweb commented 3 years ago

@encodia I believe it has.

Of course it has... Ok, it's open source, nothing is due to anyone, but in such a case I think it's better to mark a project as discontinued / not maintained.