Parse error when using GPM

Just installed Grav and it works great. However, whenever I try to use GPM, I get this error:

Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in bin/gpm on line 16

(path to GPM truncated)

From my searching, the only solution I could find for this is making sure I have the latest version of PHP. I’m using PHP 5.6, and the requirements say that it only needs 5.4 or higher. What else could be going on here?

Thanks!

Depending on your environment, your CLI php version could be different from the one used by apache/nginx/… Could you try executing php -v from the command line (preferably from your grav root folder).

Ah. All versions of php are installed on my server, but I needed to change the default CLI version. And now it works! Thanks!