I started getting this error in Sublime Text 3 when saving files:
Warning. PHP 5.6 or newer is required. Please, upgrade your local PHP installation.
I am using Sublime SFTP as well. I am not using local XAMP environment but did install php 5.6 on my local machine (MacOSX) to try and fix the problem. I also reinstalled all packages related to PHP, but the error persists.
So I ran into this same issue on my computer, but the thing is I most definitely have PHP 5.6 installed:
After looking at the phpfmt package's default settings I notices a commented out line:
// "php_bin":"/usr/local/bin/php",
It looked like a way of hardcoding the path to your php binary.
I installed php 5.6 via homebrew so I knew the binary was stored in an atypical location, so I:
which php
No more error and the package still formats per psr standards.
So, just for clarity, my User specific settings for the phpfmt
bundle:
Look like this:
{
"psr2": true,
"version": 1,
"php_bin":"/usr/local/opt/php56/bin/php", // change this path to whatever the path to your local php 5.6 binary
}
Thanks for pointing me to the right direction @hungtd. I tried
"php55warning": false
"php56warning": false
"php55compat": true
but none worked.
The solution I found was this: manually edit phpfmt.py file (Sublime Menu > Browse Packages > phpfmt) and comment out line 230:
# sublime.message_dialog('Warning.\nPHP 5.6 or newer is required.\nPlease, upgrade your local PHP installation.')
No more dialogs on saving :)
Click on Menu > Preferences > Browse Packages
Then you will find "phpfmt" Folder. You will find "phpfmt.py" file in that.
Comment following lines ( Probably Line no: 745,746,747)
if err.decode('utf-8'):
ret += ("phpfmt (php version) err:\n"+err.decode('utf-8'))
ret += "\n"
And it Works!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With