-1

I needed to reinstall my Mac and now I'm using AMPP instead of MAMP for my Apache and SQL server.

After I put my complete Symfony Projekt ( including composer.phar file ) in my www folder and launched it on localhost/www/Seotool/web/app_dev.php I get this exception:

FatalErrorException: Compile Error: Cannot redeclare class SessionHandlerInterface in /Applications/AMPPS/www/Seotool/app/cache/dev/classes.php line 1072

I also cleared the cache.

Can someone help me ?

Marvin
  • 157
  • 14
  • Try reinstalling the dependencies. Your class cache file is created in a Composer post-install hook, so the caches are then rebuilt. – kix Aug 25 '14 at 13:10
  • What do you exactly mean? How can I reinstall it? – Marvin Aug 25 '14 at 13:13
  • you could just clean the `vendor/` dir and then run `php composer.phar --install` – kix Aug 25 '14 at 13:15
  • I did. In the console following exception: [RuntimeException] An error occurred when executing the "'cache:clear --no-warmup'" command. And in the browser: FatalErrorException: Compile Error: Cannot redeclare class SessionHandlerInterface in /Applications/AMPPS/www/Seotool/app/cache/dev/classes.php line 1072 – Marvin Aug 25 '14 at 13:33
  • 1
    possible duplicate of [Symfony 2 - Fatal error: Cannot redeclare class SessionHandlerInterface in C:\...\app\cache\dev\classes.php on line 532](http://stackoverflow.com/questions/14689307/symfony-2-fatal-error-cannot-redeclare-class-sessionhandlerinterface-in-c) – Alexey B. Aug 25 '14 at 13:37
  • Symfony2 worked till yesterday on PHP 5.5.3. After clearing cache following exception is thrown: PHP Fatal error: Call to undefined function Doctrine\Common\Annotations\token_get_all() in /Applications/AMPPS/www/Seotool/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php on line 56 Fatal error: Call to undefined function Doctrine\Common\Annotations\token_get_all() in /Applications/AMPPS/www/Seotool/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php on line 56 – Marvin Aug 25 '14 at 13:43

2 Answers2

1

Make sure you're using the correct PHP installation. Check that your phpinfo has a ctype block and that the ctype functions is enabled.

It's possible that your PHP was compiled with --disable-ctype flag. How did you install it? Was it the system built-in version?

Try installing PHP with Homebrew and mind the --disable-ctype flag.

kix
  • 3,290
  • 27
  • 39
  • I updated my Question. Problem with ctype is solved. New exception... PHP Version is 5.5 , ctype is enabled. – Marvin Aug 25 '14 at 13:09
0

I solved the issue due following steps:

My Macbook Pro was with the Beta Yosemite OS. I deleted the recovery partition, installed OSX 10.8 Lion on my MB. After that I upgradet to the OSX 10.9 Mavericks. Then I downloaded MAMP, installed it, renamed the MAC PHP to PHP.BACKUP, made a symlink from php to /Applications/MAMP/bin/php/php5.5.10/bin/php , restartet apache, downloaded composer to htdocs directory, created a new Symfony2 project, setted the user and group of this project with chown -R user:group myproject , put umask(0000) into app/console and web/app_dev.php , launched it in my Browser. It worked. So I putted my backup of my old Symfony Project, putted it into my htdocs folder, setted new correct user and group settings for this project with chown -R user:group oldsymfonyproject and voila - all worked like before :) Just need to create the database again :)

Marvin
  • 157
  • 14