3

I have the following simple command:

 $process = new Process("php /Users/Name/Sites/App/app/../bin/console cache:clear --env=prod");
 $process->run();

when I try to run this it gives me:

string(153) " Parse error: parse error in /Users/Name/Sites/App/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php on line 278 "

What is wrong?

3
  • 1
    php version? DependencyInjection component version? Commented Mar 4, 2016 at 7:35
  • In my projects console's path is app/console instead of bin/console. Are you sure about your path? Commented Mar 4, 2016 at 9:09
  • Please add the PHP and Symfony versions in your question. As it's written, it's hard to answer to this question because there's too little information. Commented Mar 7, 2016 at 12:58

2 Answers 2

3
+25

Looks like you are using Symfony 3.0 that has "finally" https://github.com/symfony/symfony/blob/3.0/src/Symfony/Component/DependencyInjection/Container.php#L282

PHP 5.5 and later has support for "finally" in try/catch blocks. http://php.net/manual/en/language.exceptions.php

And looks like your php version is less then 5.5, so upgrade your php version > 5.5 and it will work

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

2 Comments

Specifically, Symfony 3.0 requires PHP >=5.5.9.
Yes, exactly, thanks for more presize version symfony.com/doc/current/reference/requirements.html
-1
$process = new Process("php /Users/Name/Sites/App/app/../bin/console cache:clear --env=prod");
$process->run();

You should try

$process = new Process("php /Users/Name/Sites/App/app/console cache:clear --env=prod");
 $process->run();

Because console is in app/ directory and not in bin/

1 Comment

You should change the tag therefore

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.