Comments (17)
- What is the output of
command -v php-version
? - What is the output of
echo $(find $(brew --cellar) -maxdepth 1 -type d | grep -E 'php[0-9]+$')
from php-version.
Here you go.
~ command -v php-version
php-version
~ echo $(find $(brew --cellar) -maxdepth 1 -type d | grep -E 'php[0-9]+$')
/usr/local/Cellar/php54 /usr/local/Cellar/php55
from php-version.
Please excuse the delay.
Please try running the master branch and paste the output of the "bug-report" script. Instructions are listed here:
https://github.com/wilmoore/php-version/wiki/Troubleshooting
from php-version.
Hi,
Below is the output of the "bug-report".
## System
Darwin Ngoc-rMBP.local 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
## Script
VERSION: php-version
TYPE: php-version is a shell function
## Environment
SHELL: /usr/local/bin/zsh
PATH: /Users/ngocpham/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/Users/ngocpham/.gem/ruby/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/bin:/bin:/usr/sbin:/sbin
PHPS:
PHP_VERSIONS:
## Homebrew
VERSION: 0.9.5
PATH: /usr/local/bin/brew
PHPS: /usr/local/Cellar/php54
/usr/local/Cellar/php55
## PHP
VERSION: 5.4.20
from php-version.
I've recently realized that you've got to unlink the brewed formulas; perhaps that will help in this case:
brew unlink php54
brew unlink php55
from php-version.
php55
hasn't been linked yet because php54
is in-use. Just unlink php54
but nothing changes.
~ php-version
~ brew unlink php54
Unlinking /usr/local/Cellar/php54/5.4.20... 576 links removed
~ php-version
EDITED: It works with the master code, I think.
from php-version.
Not quite sure if it's actually works. Installed version from homebrew
still shows nothing.
Do the steps noted in here and trigger php-version
, I get:
5.4.20
5.5.4
Yes, there's a space before 5.4.20
.
This seems to work regardless I have linked or unlinked the php54
brew. I can now use php-version 5
to switch to php55
, or php-version 5.4
to switch to php54
. php -v
shows that it has been switched.
However, the php-version
command solely still doesn't show the current "active" version.
from php-version.
What I've noticed is that the switching will work regardless of linking or unlinking; however, the "current" version detection gets confused if you have a linked PHP. This is because homebrew-php links the php binary to the $HOMEBRW_PREFIX/bin directory which effectively makes it the first php found even if you haven't actually told php-version
that you want to switch to a particular version. So, it's better to always unlink even if it seems like it is working without unlinking.
So, I would try to unlink, then start a new shell, type php-version
and see if it shows a *
next to any version (it should if you've added php-version 5
to your shell profile). BTW, there should always be two spaces before the version when you type php-version
. The first spot is reserved for the current version *
and the second space is always blank, then there is the version.
Should look something like this:
* 5.4.20
5.5.4
I'm going to install a second version of php to see if I can replicate what you are seeing. In the meantime, let me know if unlinking helps.
from php-version.
What I said above is when I both tried to unlink the php54
and relink it. In both cases, triggering php-version
(the temporary from master
) always shows the output I posted.
To be more clear about this, I will tell you my steps.
- Clone git to get latest changes from
master
into/tmp
brew unlink php54
- Open new iTerm tab
php -v
report system version, which is5.3.x
source php-version/php-version.sh
php-version 5
php -v
shows5.5.4
, so the latest script works on switching PHP versionphp-version
still show 2 versions without any*
indicating current active version
Am I getting it wrong or what?
Thank you for your support.
from php-version.
@ngocphamm: thanks for the info...yes, I see what may be going wrong. Since I have never had more than one homebrew php version installed at once (I generally compile on my own), I didn't notice this issue.
You are definitely seeing a bug. I'm heading to the gym now but tonight I will be able to check into and correct this issue.
Thanks for hanging in there...this should be corrected soon.
from php-version.
@wilmoore Thanks for your confirmation. I just thought that it would be my wrong usage of it. Have a good day!
from php-version.
@ngocphamm, no problem.
This is resolved by de8331d. To verify, please try against the latest in mater.
from php-version.
It's okay now. I can switch and see my current "active" version. Thank you very much for it. Waiting for a release and a pull request on homebrew
for this update.
from php-version.
Excellent. I'll close this since all you need now is this to be merged: josegonzalez/homebrew-php/pull/775
from php-version.
BTW, it doesn't actually have to be merged for you to install it. You can install version 0.10.3
with a direct link to the commit:
% brew remove php-version
% brew install https://raw.github.com/wilmoore/homebrew-php/1fe5bdf389e8ad19fb816d3d093c26faa834203c/Formula/php-version.rb
from php-version.
Cool! Thanks a lot!
from php-version.
Anytime 👍
from php-version.
Related Issues (20)
- Support for release-candidates installed by Homebrew HOT 2
- brew install doesn't create symlink HOT 3
- init script is not finding my brew-installed php versions. all installed today. HOT 15
- Sorry, but php-version was unable to find version '5' under ''. HOT 14
- line 43: /usr/local/Library/ENV/4.3/sed: No such file or directory HOT 13
- No symlink for /usr/local/bin/php HOT 1
- Re-write in a language that can produce a standalone binary
- Supports .phpversion HOT 4
- [Feature] Switch PHP versions when entering in a project folder HOT 1
- I change the php version but the php-fpm does not change
- Add changelog HOT 1
- doesn't switch between version 5.3.29 and 5.6.33
- brew versions not picked up anymore HOT 4
- php-version has been removed from homebrew HOT 7
- Doesn't switch versions on ubuntu HOT 4
- Can not work HOT 3
- homebrew/php was deprecated HOT 4
- 无法安装了 HOT 1
- Readme is misleading about windows support HOT 2
- Does not work with fish 3.1.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-version.