1

I created a new Symfony project using composer:

composer create-project symfony/framework-standard-edition ./

After vendor downloads and the parameter.ini file questions I get the following error:

PHP Parse error: parse error, expecting')'' in /Users/..../app/cache/dev/appDevDebugProjectContainer.php on line 20`

I inspected the file

class appDevDebugProjectContainer extends Container
{
    private static $parameters = array(
        'kernel.root_dir' => dirname(dirname(__DIR__)),     //LINE 20
        'kernel.environment' => 'dev',

I don't see why this is causing an error but removed the dirname(dirname(__DIR__)) and I hardcoded the absolute path.

I tried to run ./app/console and got another error within the appDevDebug file, another reference to __DIR__.

I was able to get through a few of these by hardcoding the path but eventually got to a different error message altogether (still within the appDevDebug file).

This file is autogenerated so I decided to stop going down that path... Any idea what would be causing this?

I have run php app/check.php and it says my system is configured to run symfony. I also have older installs of symfony (2.4, 2.5) on the same machine and they run fine.

2
  • can you try this: php app/console cache:clear --verbose Commented Dec 3, 2014 at 1:40
  • I get the same error. I also get this error if I run sudo rm -rf app/cache/* and then run app/console Commented Dec 3, 2014 at 6:47

2 Answers 2

1

I had to change composer.json:

"require": {
    ...
    "symfony/symfony": "2.6",
...

Previously it used dev branch

"symfony/symfony": "2.6.x-dev",

After that change it went smoothly.

UPDATE

Actually you might have to use service.xml not service.yml. For some reason service.yml does not work for me (it is ignored).

Sign up to request clarification or add additional context in comments.

Comments

0

I'm researching the same issue and found those solutions so far:

Have you set your timezone for the CLI php.ini ? You can check with this:

php --info | grep timezone

Alternatively you can clear the cache and try again:

rm -Rf app/cache/dev (prod instead of dev for a productive environment)

2 Comments

The timezone is set, Default timezone and date.timezone => America/Los_Angeles.
I have tried clearing the cache sudo rm -rf app/cache/* and still get same error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.