Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working anymore after homebrew switched the core #45

Closed
phoenixg opened this issue May 2, 2018 · 8 comments
Closed

Not working anymore after homebrew switched the core #45

phoenixg opened this issue May 2, 2018 · 8 comments

Comments

@phoenixg
Copy link

phoenixg commented May 2, 2018

→ brew-php-switcher 71 
Switching to php71
Switching your shell
Unlinking /usr/local/Cellar/php@5.6/5.6.36... 0 symlinks removed
Unlinking /usr/local/Cellar/php@7.1/7.1.17... 0 symlinks removed
Unlinking /usr/local/Cellar/php/7.2.5... 0 symlinks removed
Warning: php@7.1 is keg-only and must be linked with --force
Note that doing so can interfere with building software.

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.zshrc
You will need sudo power from now on
Switching your apache conf
Restarting apache
All done!


# phx at phx.local in ~ [15:07:53]
→ php --version
PHP 5.6.30 (cli) (built: Oct 29 2017 20:30:32)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
@DHorning42
Copy link

So... don't hit brew update. Got it!

@dbalabka
Copy link

dbalabka commented May 5, 2018

@phoenixg try to install HEAD version:

brew upgrade brew-php-switcher --HEAD

@phoenixg
Copy link
Author

phoenixg commented May 7, 2018

@torinaki Seems not working

# phx at phx.local in ~ [9:43:47]
→ brew-php-switcher 5.6
Switching to php@5.6
Switching your shell
Unlinking /usr/local/Cellar/php@5.6/5.6.36... 25 symlinks removed
Unlinking /usr/local/Cellar/php@7.1/7.1.17... 0 symlinks removed
Unlinking /usr/local/Cellar/php/7.2.5... 0 symlinks removed
Linking /usr/local/Cellar/php@5.6/5.6.36... 25 symlinks created

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/php@5.6/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/usr/local/opt/php@5.6/sbin:$PATH"' >> ~/.zshrc
You will need sudo power from now on
Switching your apache conf
Password:
Restarting apache
All done!

# phx at phx.local in ~ [9:44:02]
→ php --version
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so' - dlopen(/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so' - dlopen(/usr/local/Cellar/php@7.1/7.1.17/lib/php/20160303/imagick.so, 9): image not found in Unknown on line 0
PHP 7.1.17 (cli) (built: Apr 26 2018 22:04:34) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.17, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

@ikari7789
Copy link
Collaborator

@PhoenixNG I’d suggest trying to manually unlinking the old php brews if you still have them installed. It’s working on my machine, but I completely deleted and reinstalled PHP between the switch. It was a major change that was extremely poorly executed. May still be cruft leftover from before. I’m hoping that in the future that this script could also help manage extensions as well, but for now that needs to be handled by the user.

brew unlink php56
brew unlink php70
brew unlink php71
brew unlink php72

@phoenixg
Copy link
Author

phoenixg commented May 7, 2018

@ikari7789 @philcook After I unlink and uninstall all of these, I have not those error anymore, I can switch to PHP 5.6/7.2 now. But I meet a new problem:

php --version
Failed loading /usr/local/opt/php56-xdebug/xdebug.so:  dlopen(/usr/local/opt/php56-xdebug/xdebug.so, 9): image not found
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-igbinary/igbinary.so' - dlopen(/usr/local/opt/php56-igbinary/igbinary.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-kafka/kafka.so' - dlopen(/usr/local/opt/php56-kafka/kafka.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mongodb/mongodb.so' - dlopen(/usr/local/opt/php56-mongodb/mongodb.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mysqlnd_ms/mysqlnd_ms.so' - dlopen(/usr/local/opt/php56-mysqlnd_ms/mysqlnd_ms.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-rdkafka/rdkafka.so' - dlopen(/usr/local/opt/php56-rdkafka/rdkafka.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-redis/redis.so' - dlopen(/usr/local/opt/php56-redis/redis.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-swoole/swoole.so' - dlopen(/usr/local/opt/php56-swoole/swoole.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-zookeeper/zookeeper.so' - dlopen(/usr/local/opt/php56-zookeeper/zookeeper.so, 9): image not found in Unknown on line 0
PHP 5.6.36 (cli) (built: Apr 26 2018 22:03:06)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

I tried to install using PECL, but failed:

→ pecl install igbinary
No releases available for package "pecl.php.net/igbinary"
install failed

How do I install my missing dynamic libraries using PECL?

@dbalabka
Copy link

dbalabka commented May 7, 2018

@philcook I had completely the same issue. The newest version (HEAD) have solved this issue for me. It wasn't the only change I did:

  1. I have upgraded all PHP versions
  2. There were some problems with extensions. I have installed some extensions via pecl, because some of them are not available in brew anymore.

Here is my $PATH value:

echo $PATH
/usr/local/sbin:/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/include/darwin:/Users/torinaki/.cabal/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

@ikari7789
Copy link
Collaborator

Upgraded version of this script was finally merged into homebrew. Closing ticket.

@lookphp
Copy link

lookphp commented Sep 23, 2018

brew-php-switcher 5.6
Switching to php@5.6
Switching your shell
Unlinking /usr/local/Cellar/php@5.6/5.6.38... 0 symlinks removed
Unlinking /usr/local/Cellar/php@7.0/7.0.32... 25 symlinks removed
Unlinking /usr/local/Cellar/php@7.1/7.1.22... 0 symlinks removed
Unlinking /usr/local/Cellar/php/7.2.10... 0 symlinks removed
Linking /usr/local/Cellar/php@5.6/5.6.38... 25 symlinks created

If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/php@5.6/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@5.6/sbin:$PATH"' >> ~/.zshrc
You will need sudo power from now on
Switching your apache conf
grep: /etc/apache2/httpd.conf: No such file or directory
sed: /etc/apache2/httpd.conf: No such file or directory
grep: /etc/apache2/httpd.conf: No such file or directory
sed: /etc/apache2/httpd.conf: No such file or directory
grep: /etc/apache2/httpd.conf: No such file or directory
sed: /etc/apache2/httpd.conf: No such file or directory
grep: /etc/apache2/httpd.conf: No such file or directory
sed: /etc/apache2/httpd.conf: No such file or directory
sed: /etc/apache2/httpd.conf: No such file or directory
Restarting apache
All done!

it was switched ,but apache can not use ,just print php lines and don't have function . how to change apache 's httpd.conf
my path is /usr/local/etc/http/httpd.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants