(函数。simplexml-load-file]: I/O警告:未能加载外部实体(cakephp)

时间:2022-10-10 12:44:22

I have some part of codes that they do some work on a xml file.

我有一些代码,它们在xml文件上做一些工作。

they work perfectly out of cakephp.

他们完全用cakephp工作。

but when i put it in my framework it not work. "simplexml_load_file" function in my framework cant find the xml file .but the xml file is in the same folder which the class caller is in it!

但是当我把它放在我的框架中时它就不起作用了。我的框架中的“simplexml_load_file”函数找不到xml文件,但是xml文件在类调用者所在的文件夹中!

code :

代码:

$xmlObj = simplexml_load_file("certificate.xml");

error :

错误:

Warning (2): simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "certificate.xml" [APP\libs\r_s_a_processor.php, line 17]

警告(2):simplexml_load_file()函数。: I/O警告:未能加载外部实体的证书。xml”(APP \ libs \ r_s_a_processor。php,第17行)

I cant set complete path like "http://www.sample.com/app/libs/certificate.xml" beacuse htaccess change the path to the 404 page.

我无法设置完整的路径,如“http://www.sample.com/app/libs/certificate.xml”,因为htaccess更改了通往404页面的路径。

what is the solution? I even put the xml file in the webroot/files path! but nothing changed :(

解决方案是什么?我甚至把xml文件放在webroot/files路径中!但是没有改变了:(

(函数。simplexml-load-file]: I/O警告:未能加载外部实体(cakephp)

1 个解决方案

#1


0  

Try to echo gwtcwd(); just before, you'er sure that's the right directory

试着回声gwtcwd();在此之前,您肯定这是正确的目录

#1


0  

Try to echo gwtcwd(); just before, you'er sure that's the right directory

试着回声gwtcwd();在此之前,您肯定这是正确的目录