1

Iam new with php and creating an rest API for test purposals (for an android app). I use doctrine as ORM for my PHP project and it works fine localy with XAMPP.

Since i uploaded the project to an external hosting provider i got constantly an error:

[18-Feb-2016 10:25:12 Europe/Amsterdam] PHP Fatal error:  Uncaught Error: Class 'Doctrine\Common\Collections\ArrayCollection' not found in /home/aaapi/public_html/src/Alert.php:40
Stack trace:
#0 /home/aaapi/public_html/dataManagers/AlertManager.php(60): DemoApi\src\Alert->__construct('heerlen', Object(DemoApi\src\Child))
#1 /home/aaapi/public_html/create_alert.php(22): DemoApi\dataManagers\AlertManager->createAlert('heerlen', Array)
#2 {main}
thrown in /home/aaapi/public_html/src/Alert.php on line 40

I EXACLY followed http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/association-mapping.html 5.5. (one to many bi directional)

I tried to remove

use Doctrine\Common\Collections\ArrayCollection;

and replace the:

$this->children = new ArrayCollection();
    //replaced by
$this->children = new Doctrine\Common\Collections\ArrayCollection();

This also doesn't fix the problem.

Has someone a solution?

CodeNinja
  • 836
  • 1
  • 15
  • 38
  • Are the PHP versions equivalent? – Oscar Pérez Feb 19 '16 at 09:11
  • 1
    just an stupid question: did you cleared `Symfony`'s cache? – Oscar Pérez Feb 23 '16 at 09:25
  • it isn't a stupid question. I never heared about this. I googled it and i can clear it by a console command? but in which console? from my host? when yes then i need to mail my host to ask where to find this? or are iám totaly wrong? When i don't use the doctrine arraycollection everything works fine online to. – CodeNinja Feb 23 '16 at 11:02
  • You should ssh to your host and, from the symfony folder, run `app/console cache:clear --env=prod --no-warmup`. If you cannot `ssh`, then, remove the `~/app/cache/*` folder – Oscar Pérez Feb 23 '16 at 11:37
  • symfony is a framework? i don't use a framework, only doctrine nothing else. I cant find a "cache" dir in my whole FTP directory structure. i also can't ssh becouse it is a "normal" webhosting package i hire from neostrada.nl – CodeNinja Feb 23 '16 at 14:23
  • 1
    Ok, excuseme, I didn't nptice you were'nt using Symfony... I have got no experience using Doctrine by itself... I wish you have luck in finding a solution! – Oscar Pérez Feb 23 '16 at 14:29
  • No problem, thanks for your help anyway! – CodeNinja Feb 23 '16 at 14:44

0 Answers0