Comments (7)
GOT IT !
Running phpversion()
on specific version rather than default CLI indeed has shown me the error (with imagemagik). Went on and disabled it and, lo and behold, nothing's broken anymore ! TIL: where exactly are the executable that enables me to do that !
Thanks for your help !
from phpmon.
You got me to the right directions !
I had a export PATH="$(brew --prefix php)/bin:$PATH"
to make sure PHP was loaded. I don't know why I did this, but it's definitely not really useful. Commenting it out has the right CLI version loading up. And boy does it make my shell snappy when loading it ! Good riddance to that line ! :)
Thank you again !
from phpmon.
When PHP Monitor warns you about a broken PHP version, it usually means that php -v
contains some sort of warning.
So let's find out! While PHP Monitor displays "BROKEN", what does php -v
output in your terminal? That should help you understand more what's going on.
Feel free to post the output below.
from phpmon.
All right, so having PHP Montitor set to:
- PHP 8.0, output is normal, gives me version 8.0.3. PHP info, from the PHP Monitor menu says 8.0.3 with not errors either.
- PHP 7.1, output is normal, gives me version... 8.0.3. PHP info, from the PHP Monitor menu says 7.1.33 with not errors either.
- PHP 7.4, output is normal, gives me version... 8.0.3, PHP info, from the PHP Monitor menu says 7.4.6 with not errors either and with this one, the status bar icon is "broken".
Even if it says broken, I can load perfectly load my local PHP applications on the "broken" 7.4.
Seems it doesn't switch the PHP CLI, but only PHP-FPM, I don't know if it's normal behavior :)
from phpmon.
Why you're getting "broken"
The thing is, PHP Monitor indicates an installation is "broken" if the PHP version you selected contains the string "warning" or "error" in the output of php -r "print phpversion();"
.
(But note, I specifically run that on the PHP binary, not the PHP version that is linked. So since your CLI is always on 8.0, it makes sense you're not seeing the warnings.)
Diagnostics
Try running:
/usr/local/opt/[email protected]/bin/php -r "print phpversion();"
OR
/usr/local/opt/[email protected]/bin/php -v
You should see an error or a warning here in the output. Usually this is a duplicate extension declaration causing issues, or an extension that couldn't be loaded. You'll have to solve that issue yourself (usually by removing the offending extension or reinstalling).
(If you are on Apple Silicon, this becomes: /opt/homebrew/opt/[email protected]/bin/php -r "print phpversion();"
due to the updated location of Homebrew.)
Possible solution
Can you try the "Force load latest PHP version" (which usually fixes misconfigurations) and then switch to PHP 7.4?
After you've done this, what do you get on the CLI then when you run php -v
?
from phpmon.
Hey, figured I'd ask you... I never really worked with multiple version on my dev machine, and PHP Monitor got me excited for finally an easy solution for that... So I wonder, is there a way that we could also make the switch for PHP-CLI when switching within PHP Montior ?
from phpmon.
Since PHP Monitor changes the linked version via Homebrew, it should already do this! After switching, both Valet and your terminal (CLI) should use the new PHP version.
If you've got your shell environment set up correctly, and your PATH points to Homebrew's bin
folder, you should automatically have the PHP version that is linked accessible in your terminal.
That might look like this:
export PATH=$HOME/bin:/usr/local/bin:$PATH
You might have a specific version of PHP linked if that is not the case. In that case, you may need to change your .bashrc
/.bash_profile
/.zshrc
file where the PATH is set (depending on the terminal you use).
You can find out which version of PHP is being used by running which php
.
which php
should return either /usr/local/bin/php
or /opt/homebrew/bin/php
. (If you go there with Finder, you'll find that this is simply an alias to the /opt folder we discussed earlier in this thread.)
from phpmon.
Related Issues (20)
- PHP Monitor icon not displaying in menu bar (while not crashing) HOT 2
- Do not require restart when PHP installation(s) change HOT 3
- Keep track of last globally linked PHP version HOT 9
- Domain isolation needed on cli level also HOT 1
- Version constraints with wildcard are not parsed correctly HOT 1
- "Stop Valet Services" not working HOT 4
- Deprecation messages cause Valet version parsing issue HOT 14
- Upgrade PHP Monitor not working HOT 3
- Extremely slow performance after upgrade to 5.7.2 HOT 4
- Restore Homebrew Permissions always fails HOT 8
- The service `PHP` is not working.
- Crash on start HOT 4
- App crashes at launch (due to missing field in Homebrew output) HOT 7
- Homebrew cache directory permission issue HOT 7
- Verify PHP Monitor plays nice with Homebrew 4.0 HOT 1
- Crash immediately after launch HOT 13
- ⚠️ PHP Monitor now requires macOS 12.4 or newer HOT 1
- Error 502 Bad Gateway
- Your valet version could not be read
- Mac OS v12.1 Not Working HOT 1
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 phpmon.