Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error when bin/grav install #25

Closed
coreych opened this issue Aug 22, 2014 · 20 comments
Closed

Parse error when bin/grav install #25

coreych opened this issue Aug 22, 2014 · 20 comments
Assignees
Labels
Milestone

Comments

@coreych
Copy link

coreych commented Aug 22, 2014

git clone grav.git
bin/grav install

Parse error: parse error in /Users/corey/Programs/webroot/grav/system/src/Grav/Console/CleanCommand.php on line 15

@w00fz
Copy link
Member

w00fz commented Aug 22, 2014

What PHP version are you using? A version 5.4 or higher is required to run Grav [reference]

@rhukster
Copy link
Member

I suspect you are running PHP 5.3 in your CLI because that error is tripping up on the new PHP array short syntax: $var = ['something', 'else'] In PHP < 5.4 you would have to have done: `$var = array('something', 'else')'

@coreych
Copy link
Author

coreych commented Aug 23, 2014

You are right, upgrading to PHP 5.4 works. Thank you.

@coreych coreych closed this as completed Aug 23, 2014
@mahagr mahagr added the bug label Aug 23, 2014
@mahagr mahagr added this to the 0.9.0 Release milestone Aug 23, 2014
@mahagr
Copy link
Member

mahagr commented Aug 23, 2014

We need version check to bin/grav as well.

@w00fz
Copy link
Member

w00fz commented Aug 23, 2014

Now exists properly if it detects the php version doesn't match the one required.
Thanks!

@erata
Copy link

erata commented Aug 24, 2015

hi, i use xampp v3.22 with PHP Version 5.6.11 and when i want to install a module or do something i take an error: "You are running PHP 5.3.19, but Grav needs at least PHP 5.4.0 to run".
could you help me...

@flaviocopes
Copy link
Contributor

Your version of xampp looks outdated, it's using PHP 5.3 in the command line. Upgrade xampp and it should be fine.

@erata
Copy link

erata commented Aug 24, 2015

i install new version of xampp and its php version is 5.6.11 when i look at phpinfo

@flaviocopes
Copy link
Contributor

Where are you getting that error, in the command line (running gpm) or in the browser?

@erata
Copy link

erata commented Aug 24, 2015

Command line

@flaviocopes
Copy link
Contributor

The version used in the web server is different than the command line PHP version. I'm not sure how to upgrade that in xampp. You might want to check that in the xampp docs / ask in their forums.

@flaviocopes
Copy link
Contributor

(you can still install a plugin by downloading the latest version in the zip package and put it in /user/plugins, but of course using the command line is more convenient)

@erata
Copy link

erata commented Aug 24, 2015

my used programs: MINGW32 (Git Bash), XAMPP the last version (PHP 5.6.11) and grav last version, but i could not run any module with comman line...

@giansi
Copy link

giansi commented Aug 24, 2015

@erata Grav does not require a database, so why are you using XAMPP? Why don't you try with the PHP internal server, so you can run PHP both from web browser and cli with a single configuration? Here's a guide that could help you. http://diblas.net/blog/how-to-install-php-to-run-grav-cms-under-windows. Anyway, if you want to use XAMPP, try to find out how to configure the cli with XAMPP. Good luck

@erata
Copy link

erata commented Aug 26, 2015

hi, i install php and apache but again the message about php version low...
is there a different program for windows except MINGW32 (Git Bash) to run grav on command line?
maybe the problem is command line program.

@flaviocopes
Copy link
Contributor

I think you just need to add the path to the correct PHP version to use. I'm not using Windows so I don't know the exact procedure, but I found these tutorials you can follow to change the PHP version it uses

@erata
Copy link

erata commented Aug 28, 2015

hi, i found the problem. it arise from iis express php installation which i install with web installer platform before, it use php 5.3 version and git bash see this program's php version. after i remove iis php the problem resolved.

thanks,

@flaviocopes
Copy link
Contributor

Glad you sorted it out!

@johncarter-oz
Copy link

Hi, I know this is an old thread but I am also getting the parse error and I can explain the problem yet I do not know the way around.
So, my *nix is runnning PHP 5.4.16 (yes, I know it needs to be 5.5.9 or above) but my virtual server is running the very latest.
So Apache has no problem but to create an admin user, I SSH in but cannot execute the script to generate admin user due to the underlying "system" version of php.
We are using BlueOnyx. You can see here: http://www.blueonyx.it/index.php?page=multi-php about running multiple php versions but only for serving up web pages...
Any ideas?
Thank you in advance. BTW, if I should make a new thread for this, please tell me.

@flaviocopes
Copy link
Contributor

Your hosting should provide a way to update the CLI version of PHP.
Contact their support, as every host handles this kind of thing differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants