2

In my project with Symfony, I have this random error appear when I go to random page in my application:

ContextErrorException: Warning: simplexml_load_file(): I/O warning : failed to load external entity "C:\wamp\www\Symfony\vendor\friendsofsymfony\user-bundle\Resources\config\doctrine\model/User.orm.xml" 

in C:\wamp\www\Symfony\vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\Driver\XmlDriver.php line 736

Refresh the page many times seems to disable this error until it appears again.

I think, Symfony try to load .xml format but FOSUserBundle is in .yml.

I use Symfony 2.5.6, and the 5.5.12 php version with WAMP Server.

For now, this error is not disturbing my application developpement, but I would like to find the solution anyway. I don't understand why I have this error now.

The only things change in my application is that I insert some datas in my database with SQL request (in fact I use some data which already exist in another database, I have to import them in my new database with SQL on PhpMyAdmin, but nothing came wrong with SQL when I inserted them). The import worked well and there's no mistake with the datas of my database project.

french_dev
  • 2,117
  • 10
  • 44
  • 85

2 Answers2

3

Hi @Julien FOSUser issue#1062 and symfony2 issue#7291 will help to resolve your problem.

kuldipem
  • 1,719
  • 1
  • 19
  • 32
  • Thank you for reply your answer. My application did'nt return me the error since I have posted this question here. I will try your links to see what I can do. But, I don't understand why I had this error, and since this post no error... – french_dev Nov 20 '14 at 13:47
-1

the line 707 XmlDrive.php has to changed form:

$xmlElement = simplexml_load_file($file);

to

$xmlElement = @simplexml_load_file($file);

This is a strange solution but it works!

NB: pay attention when updating your bundles...

Amine Jallouli
  • 3,919
  • 8
  • 36
  • 73
  • 1
    The @ is only to hide the error, it doesn't solve the problem. – Nawfal Serrar Mar 13 '15 at 07:08
  • I prefer to fix it, than hide it, you need to know what is wrong if you begin hiding fatal errors at one point you wont know where the problem is, fatal error breaks the website.. btw its only you who should see the error not the user, if users see errors then there is another problem – Nawfal Serrar Mar 16 '15 at 02:53