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: syntax error, unexpected '[' #2

Open
deanbarrow opened this issue Aug 1, 2014 · 2 comments
Open

Parse error: syntax error, unexpected '[' #2

deanbarrow opened this issue Aug 1, 2014 · 2 comments

Comments

@deanbarrow
Copy link

What version of php are you running this on?

After installing I got the error:

Parse error: syntax error, unexpected '[' in .../app/api.php on line 13

Tried editing things but got the same error but in config.php on line 7

I'm using php v5.3.28.

@gellu
Copy link
Owner

gellu commented Aug 1, 2014

I'm using 5.4.31
You have to have php 5.4 to use short array notation

Please try changing line 13 in api.php from:

$requestPath = parse_url($_SERVER['REQUEST_URI'])['path'];

to

parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

and in config.php use normal array syntax

$configGlobal = array (
    'slim' => array(

    ),
);

Let me know if it solves your issue, I'll update codebase to maintain compatibility with php 5.3

@deanbarrow
Copy link
Author

Thanks, I also had to do the same for config-env.php:

$configEnv = array (

Now I keep getting:

{"status":"error","result":"Method not found"}

This may be due to something else though, hopefully it's just something simple I've got wrong.

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

No branches or pull requests

2 participants