Bin/grav Permission Denied

I have an SHH terminal session set up with my remote server. bin/grav clear-cache gives me a Permissions denied error. Any call to grab or gym returns the same.

Is there a special permission setting I need for the bin folder?

They should already be 775 or 755 permissions. That’s all that is needed. It could be a problem with PHP. Try typing php -v and let me know what output you get.

I get:

PHP 5.3.28 (cli) (built: Jul 30 2014 12:17:53)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

It should be v5.4, right? So I need to figure out how to get my SSH login under PHP 5.4.

That was it. Site5 defaults SSH sessions to PHP v5.2. If I use a very ugly command like:

/usr/local/php54/bin/php bin/grav clear-cache

it works. Too bad Site5 won’t allow me to update my default PHP to 5.4. :frowning:

Bob, you just need to add the path to php 5.4 or 5.5 to your .bash_profle. See the siteground hosting docs I posted on learn. you probably don’t even need the ~bin workaround I had to do there.

I’ll be posting one soon for Arvixe hosting tomorrow, and that is a simple php path at the start of your standard path affair. Easy peasy.

Right! I got some support from Site5 (which is always great - recommended) and I needed to run these commands (for others following this thread):

cat .bashrc | grep php
alias php="/usr/local/php54/bin/php"
source ~/.bashrc

And then php -v gives me:

PHP 5.4.31 (cli) (built: Jul 30 2014 12:18:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies

Thanks!

Hmm. Maybe not so fast. I still get permissions errors like this:

bobrocke@rockefellerdomains.com [~/public_html/stage.bobrockefeller.com]# php -v
PHP 5.4.31 (cli) (built: Jul 30 2014 12:18:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
bobrocke@rockefellerdomains.com [~/public_html/stage.bobrockefeller.com]# bin/grav clear-cache
-bash: bin/grav: Permission denied

That really looks like a bash-level issue with the files requiring executable permission. Can you try manually setting it:

$ chmod 755 bin/grav

or

$ chmod u+x bin/grav

That fixed the permissions part. Now I get:

bobrocke@rockefellerdomains.com [~/public_html/stage.bobrockefeller.com]# php -v
PHP 5.4.31 (cli) (built: Jul 30 2014 12:18:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
bobrocke@rockefellerdomains.com [~/public_html/stage.bobrockefeller.com]# bin/grav clear-cache
You are running PHP 5.3.28, but Grav needs at least PHP 5.4.0 to run.

My shell thinks it’s running PHP v5.4, but Grav disagrees.

Ok follow the instructions for siteground hosting. It’s not Grav but the php that’s associated with phar files. You probably need to follow the local bin approach. Kinda crappy but some hosting companies don’t setup php support at all, they just run the default Cpanel installs with old out of date php setups.

You might want to look at WireNine hosting. Very fast. Great support response. Good pricing. And they setup php the right way. Really know what they are doing.

Nice instructions! That fixed me up. I needed to chmod both Grav and gpm, for whatever reason, and once I had the symlink into /bin set up, all seems to be working well.

I’m learning a lot from you on topics other than Grav! Thanks for your help and your time.

And I will look into WireNine. I have been thrilled with Site5’s performance and support staff, but they do seem a bit behind the PHP curve as they only offer v5.4 as their newest.

Of all the hosting providers I have tried so far, WireNine is by far the fastest. In fact their $14.95 shared hosting package provides almost the same performance as my highly optimized dedicated server! Very impressive.