Bin/gpm update error message

I keep trying to run the bin/gpm update, but get php error message - running PHP 5.3.27. However I’m running PHP 5.4.8 (confirmed by running info.php) and the grav update won’t accept this. Any suggestions?

Often your server is configured to run a different version of PHP from the CLI compared to the web server. You can test this by running:

$ php -v

From the command prompt. Depending on your host, this can usually be addressed by putting a newer version of PHP in your path. You might want to check out the hosting docs for a few hosting providers. Here’s an example of how to do it for Arvixe Hosting. You might want to check out the other hosting provider docs too, or contact your hosting provider for more help there.

Thanks. info.php says I’m running 5.4.8 (which is what my hosting provider has it set to), but php -v says 5.3.7. I put a php.ini file in the /grav folder per instructions from the provider, but that didn’t help. I’ll have to check with them to see what I need to do. Clearly this is a provider issue, not a grav issue. Thanks again for the fast response.

It is probably as simple as finding the php 5.4 CLI command (similar location to PHP 5.3? $ which php), then adding that to the front of the path. I’ve always used this approach and never had issues.

After trying several things (including adding the path to PHP in front of the command) I ended up adding an alias in my .bashrc file and a path command in my .bash_profile file.

alias: alias php=’/opt/php/php-5.4.8/bin/php’
added to .bash_profile: PATH=/opt/php/php-5.4.8/bin:$PATH:$HOME/bin

Now php -v works and bin/gpm seems to work, but I get the following when I run the bin/gpm index command:

[Whoops\Exception\ErrorException]
Undefined offset: 1
index [-f|–force]

Any suggestions?

Thanks
Phil

Hmm… Do you have all the PHP requirements ? You can probably determine what PHP has loaded by typing:

$ php -i | grep gd
$ php -i | grep curl
...etc...

Checked all the PHP requirements and they are all enabled. As far as I know the gpm is working, but just giving the Undefined offset: 1 error message. Puzzling. I appreciate all your suggestions!

Can you check in your logs/grav.log file and see if there is a more detailed error? Specifically would love to know the filename and line number that is causing the error. Then that would help identify what’s wrong on your setup.

Sorry to take so long in getting back, but have been distracted by some deadlines. Here is what the logs/grav.log file shows: 2015-07-11 12:10:02] grav.CRITICAL: syntax error, unexpected T_USE, expecting T$

Here is a more complete listing of the grav.log – the earlier one got truncated.

[2015-07-11 12:10:02] grav.CRITICAL: syntax error, unexpected T_USE, expecting T_FUNCTION - Trace: #0 /home/ztechzon/public_html/grav/vendor/filp/whoops/src/Whoops/Run.php( 357): Whoops\Run->handleError(4, ‘syntax error, u…’, ‘/home/ztechzon/…’, 25) #1 [internal function]: Whoops\Run->handleShutdown() #2 {main} [] []

I have gone through this same error with 2 other people since our initial communication. Each one turned out to be a bad PHP build. After one user went with the system PHP, things worked fine. The other user was on a mac and switched to use MAMPs PHP and it worked fine also.

I’m not sure what exactly is the problem, but something was missing or not properly configured in those PHP versions that were causing the problems.

Thanks. I’ll work with my host provider more – if you have any specifics on what was bad in the PHP build it would help. I’ve tried every version they have available.

I also have tried MAMP on my Mac which works great, except I have found another problem. The

MAMP version of grav-skeleton-blog-site is missing the images. I can see them when looking at the files, but they don’t display. I’ve reinstalled the files and still no images. The same files work fine on my host site. All the other skeleton files work fine on the MAMP site. Very puzzling.

Might be something related to the GD library, it might be missing JPEG or PNG support.