Closed kevnk closed 7 years ago
Looks like a PHP 7 feature: https://stackoverflow.com/a/34571460/622287
... now to update to php 7 ...
Here's how to update your mac's version of php to 7.1: https://stackoverflow.com/a/2526299/622287
We can look at fixing that, but yeah upgrading to PHP7 is probably a good idea anyway.
Now to get statamic
to use the php version you just installed above:
Change the first line in /path/to/composer/vendor/statamic/cli/statamic
to #!/usr/bin/env /path/to/new/php
. So my first line looks like this:
#!/usr/bin/env /usr/local/php5/bin/php
Don't modify the files like that. You should just configure your system to use the new PHP version by default.
Thanks @jasonvarga.
Instead, if you install PHP7 as detailed above, then you can add this to your .bash_profile
:
export PATH=/usr/local/php5/bin:$PATH
alias php=/usr/local/php5/bin/php # may or may not be required. I needed it for it to work.
After running on macOS Sierra:
Opening a new terminal tab and checking the version:
I'm getting the following error