[function.simplexml-load-file]:I / O警告:无法加载外部实体(cakephp)

时间:2014-12-31 06:48:52

标签: php xml cakephp

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

他们完美地完成了cakephp。

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

代码:

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

错误:

  

警告(2):simplexml_load_file()[function.simplexml-load-file]:I / O   警告:无法加载外部实体“certificate.xml”   [APP \ libs \ r_s_a_processor.php,第17行]

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

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

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试回复gwtcwd();就在此之前,您确定这是正确的目录