Jump to content

Error with config.xml


Recommended Posts

Hello all,

 

I use prestashop 1.3

 

I got an error when listing modules in the Bach Office:

 

Warning: simplexml_load_file(): supplied argument is not a valid Stream-Context resource in /var/www/vhosts/arianpars.com/httpdocs/gourmet/classes/Module.php on line 514

 

What annoys me is that It happens sometimes, not allways

 

I thought that the reason was the properties of the file config.xml and changed them. After some days working , yesterday showed the same error.

 

Here is the code and the place of the error in red

 

foreach ($modules_dir AS $module)

{

$configFile = _PS_MODULE_DIR_.$module.'/config.xml';

$xml_exist = file_exists($configFile);

if ($xml_exist)

$needNewConfigFile = (filemtime($configFile) < filemtime(_PS_MODULE_DIR_.$module.'/'.$module.'.php'));

else

$needNewConfigFile = true;

if ($useConfig AND $xml_exist)

{

libxml_use_internal_errors(true);

$xml_module = simplexml_load_file($configFile);

foreach (libxml_get_errors() as $error)

$errors[] = '['.$module.'] '.Tools::displayError('Error found in config file:').' '.htmlentities($error->message);

libxml_clear_errors();

 

Does anybody know what is happening and how to settle it?

 

Thanks in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...