1

I installed Composer successfully and now I'm trying to install Symfony 2 on a Macbook 10.5.8.

I downloaded Symfony Standard 2.5.0 (.tgz) on http://symfony.com/download and I tried to use the create-project command to generate a new Symfony application using

php composer.phar create-project symfony/framework-standard-edition path/to/install 

but I get this error:

Fatal error: Class 'Phar' not found in /Users/jenisawesome/composer.phar on line 13

Maybe it's because I have an old php version? I'm not sure. I can't even run Composer when I type in this command:

php composer.phar

I get the same error:

Fatal error: Class 'Phar' not found in /Users/jenisawesome/composer.phar on line 13
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Gretta
  • 223
  • 2
  • 5
  • 13
  • What is your version of PHP? You need at least 5.3 I believe. Run `php -v` – Brian Jun 10 '14 at 17:28
  • Also, did you look search for that error and try anything else? http://stackoverflow.com/questions/8851099 – Brian Jun 10 '14 at 17:30
  • my PHP version is 5.2.15, so ya. I guess I don't meet the requirements :\ Does that mean I have to download Symfony 1? – Gretta Jun 10 '14 at 17:39
  • I would not recommend using Symfony 1. Why are you on such an old version? 5.2 and even 5.3 are very old and not recommended to use anymore. You should try and use 5.4 or 5.5 if possible. – Brian Jun 10 '14 at 17:48
  • My mac just came with the 5.2 version. I'm trying to update it to 5.3 or higher. I should really get a new computer :\ – Gretta Jun 10 '14 at 17:57
  • Use [homebrew](http://brew.sh/) – Brian Jun 10 '14 at 18:11
  • I use mamp 1.9, but I don't really know how it works. I thought it was supposed to upgrade my php to at least 5.3 but it still stayed the same :\ – Gretta Jun 10 '14 at 18:43

1 Answers1

0

Based on discussion in the comments, this error appears to be because you're using PHP 5.2. Composer required at least 5.3.2 to run.

Aside from that, this question appears to be a duplicate of PHP: Class 'Phar' not found

Community
  • 1
  • 1
Brian
  • 7,204
  • 12
  • 51
  • 84