swiftbar / SwiftBar

Powerful macOS menu bar customization tool
https://swiftbar.app
MIT License
2.93k stars 92 forks source link

php scripts does not work under Mac OS Monterey #236

Closed lowfreq2010 closed 3 years ago

lowfreq2010 commented 3 years ago

all is does - shows error in bar. how i can fix it. my computer is mac mini M1

Screenshot 2021-11-01 at 12 14 41

lowfreq2010 commented 3 years ago

p.s i have installed php via brew install php command

melonamin commented 3 years ago

PHP has been removed in Monterey, that's why you see /usr/bin/php: bad interpreter: No such file or directory If you installed PHP through brew it would be probably in /opt/homebrew/bin/ directory.

To fix the plugin, try the following:

lowfreq2010 commented 3 years ago

thanks! it really helped. but now it shows a warning as shown on screenshot Screenshot 2021-11-01 at 16 21 18

melonamin commented 3 years ago

This question is really fro the plugin developer and should be directed to them.

But on a first glance, it looks like PHP 8 deprecated a function and you see the warning in script's output. My suggestions are either to go to a previous version of PHP or to reach out to the plugin developer.

You can install a specific version of PHP with brew, start by removing the current one and then brew install php@7.4 Double check that path and see if it fixes the issue

lowfreq2010 commented 3 years ago

thanks for suggestions. I went with third way with adding error_reporting(0); call at the top of script. and the message was supressed for good.

matopeto commented 3 years ago

Hi @lowfreq2010 the issue is on my plugin

see: https://github.com/matopeto/xcode-build-times/issues/17

i will update script to remove the duplicate warning but for now there is one manual step after install the PHP and update the plugin ... as it was writed above you must specify the path to the PHP

I raise the #238 to resolve this problem with manual rewriting of the path and support both monterey and older systems

matopeto commented 3 years ago

@lowfreq2010 deprecated usort warning was fixed, see: https://github.com/matopeto/xcode-build-times/issues/18