php - simplexml_load_file not loading the xml file -
I have trouble with simplexml_load_file. It was not loading the XML file from the specified path. The file exists in the path. It was working in my local system (Windows 7), but when I run this command on the server system (Linux) it was not working.
libxml_use_internal_errors (true); $ Xml = Simple XMLload_file ($ folder. $ Del_xml, 'simplexmail', libex ML_PARSEHUGE); If (! $ Xml) {Model_Log :: error ("Could not load XML file". $ Folder. ''. $ Del_xml); } Other {Model_Log :: info ("file {$ del_xml} load"); } Below is the XML.
& lt ;? XML version = "1.0" encoding = "UTF-16"? & Gt; & Lt; The language of the products = "GB-N" XSI: Nomamageshesama location = "test_brand.xsd" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: gdha.library = "Blur: GDHA .library "& gt; & Lt; Products & gt; & Lt; Product_category_hierarchy & gt; & Lt; Parent_category & gt; Trial & lt; / Parent_category & gt; & Lt; / Product_category_hierarchy & gt; & Lt; Product_content & gt; & Lt; Basic_information & gt; & Lt; Product_titles & gt; & Lt; Short_title & gt; Title & lt; / Short_title & gt; & Lt; Long_title & gt; Title123 & lt; / Long_title & gt; & Lt; / Product_titles & gt; & Lt; Product_descriptions & gt; & Lt; SHORT_DESCRIPTION & gt; Trial & lt; / SHORT_DESCRIPTION & gt; & Lt; Longer_Nation & gt; Test 123 & lt; / Long_description & gt; & Lt; / Product_descriptions & gt; & Lt; / Basic_information & gt; & Lt; / Product_content & gt; & Lt; / Products & gt; & Lt; / Products & gt;
-
Check your folder path You may be hard coded Try $ _SERVER ['DOCUMENT_ROOT'] to get the path.
-
Check your file name Windows Server is not case-sensitive. But Linux is case-sensitive.
-
Rename your file with fewer file letters Some Linux server file names will change their lowercase. So when you try to access the file from the browser, the result will be a 404 error.
Comments
Post a Comment