Jump to content

Aide suite a une erreur sur le haut de ma page


damtitia59

Recommended Posts

Bonjour j'ai une erreur sur la page principale du site

 

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/themes/prestashop/css/mnt/171/sdb/9/d/creation.lumena/themes/prestashop/css/modules/blockstore/blockstore.css) is not within the allowed path(s): (/mnt/171/sdb/9/d/creation.lumena) in/mnt/171/sdb/9/d/creation.lumena/classes/Tools.php on line 1329

 

 

Je suis sur un hebergement free j'utilise la version prestashop_1.4.0.13 RC4

 

Si quelqu'un peux m'aider c'est la première fois que j'utilise Presta Shop merci par avance

Link to comment
Share on other sites

hum, il y a un gros souci sur le chemin du fichier...

Vous avez 

/themes/prestashop/css/mnt/171/sdb/9/d/creation.lumena/themes/prestashop/css/modules/blockstore/blockstore.css

alors que vous devriez avoir

/mnt/171/sdb/9/d/creation.lumena/themes/prestashop/css/modules/blockstore/blockstore.css

En gros vous demandez un fichier qui n'existe pas.

 

Pouvez-vous me copier ici le contenu de la fonction public static function addCSS($css_uri, $css_media_type = 'all') contenue dans votre fichier classes/Tools.php ?

 

Le chemin généré n'est pas bon et votre hébergeur a du renforcer la sécurité, donc l'erreur apparait.

Link to comment
Share on other sites

Merci pour votre reponsse donc je note ci dessous en esperant que ce soit le bon morceau du fichier

 

public static function addCSS($css_uri, $css_media_type = 'all')
{
global $css_files;
 
// avoid useless opération...
//if (is_array($css_files) && array_key_exists($css_uri, $css_files) && $css_files[$css_uri] == $css_media_type)
// return true;
 
//overriding of modules css files
$different = 0;
$override_path = str_replace(__PS_BASE_URI__.'modules/', _PS_ROOT_DIR_.'/themes/'._THEME_NAME_.'/css/modules/', $css_uri, $different);
if ($different && file_exists($override_path))
$css_uri = str_replace(__PS_BASE_URI__.'modules/', __PS_BASE_URI__.'themes/'._THEME_NAME_.'/css/modules/', $css_uri, $different);
 
// detect mass add
if (!is_array($css_uri))
$css_uri = array($css_uri => $css_media_type);
 
// adding file to the big array...
$css_files = array_merge($css_files, $css_uri);
 
return true;
}
 
 
/**
* Combine Compress and Cache CSS (ccc) calls
*
*/
public static function cccCss() {
global $css_files, $protocol_link;
//inits
$css_files_by_media = array();
$compressed_css_files = array();
$compressed_css_files_not_found = array();
$compressed_css_files_infos = array();
 
// group css files by media
foreach ($css_files as $filename => $media)
{
if (!array_key_exists($media, $css_files_by_media))
$css_files_by_media[$media] = array();
 
$infos = array();
$infos['uri'] = $filename;
$url_data = parse_url($filename);
$infos['path'] = _PS_ROOT_DIR_.str_replace(__PS_BASE_URI__, '/', $url_data['path']);
$css_files_by_media[$media]['files'][] = $infos;
if (!array_key_exists('date', $css_files_by_media[$media]))
$css_files_by_media[$media]['date'] = 0;
$css_files_by_media[$media]['date'] = max(
file_exists($infos['path']) ? filemtime($infos['path']) : 0,
$css_files_by_media[$media]['date']
);
 
if (!array_key_exists($media, $compressed_css_files_infos))
$compressed_css_files_infos[$media] = array('key' => '');
$compressed_css_files_infos[$media]['key'] .= $filename;
}
 
// get compressed css file infos
foreach ($compressed_css_files_infos as $media => &$info)
{
$key = md5($info['key']);
$filename = _PS_THEME_DIR_.'cache/'.$key.'_'.$media.'.css';
$info = array(
'key' => $key,
'date' => file_exists($filename) ? filemtime($filename) : 0
);
}
// aggregate and compress css files content, write new caches files
foreach ($css_files_by_media as $media => $media_infos)
{
$cache_filename = _PS_THEME_DIR_.'cache/'.$compressed_css_files_infos[$media]['key'].'_'.$media.'.css';
if ($media_infos['date'] > $compressed_css_files_infos[$media]['date'])
{
$compressed_css_files[$media] = '';
foreach ($media_infos['files'] as $file_infos)
{
if (file_exists($file_infos['path']))
$compressed_css_files[$media] .= Tools::minifyCSS(file_get_contents($file_infos['path']), $file_infos['uri']);
else
$compressed_css_files_not_found[] = $file_infos['path'];
}
if (!empty($compressed_css_files_not_found))
$content = '/* WARNING ! file(s) not found : "'.
implode(',', $compressed_css_files_not_found).
'" */'."\n".$compressed_css_files[$media];
else
$content = $compressed_css_files[$media];
file_put_contents($cache_filename, $content);
chmod($cache_filename, 0777);
}
$compressed_css_files[$media] = $cache_filename;
}
 
// rebuild the original css_files array
$css_files = array();
foreach ($compressed_css_files as $media => $filename)
{
$url = str_replace(_PS_THEME_DIR_, _THEMES_DIR_._THEME_NAME_.'/', $filename);
$css_files[$protocol_link.Tools::getMediaServer($url).$url] = $media;
}
}
 
/**
* Combine Compress and Cache (ccc) JS calls
*
*/
public static function cccJS() {
global $js_files, $protocol_link;
//inits
$compressed_js_files_not_found = array();
$js_files_infos = array();
$js_files_date = 0;
$compressed_js_file_date = 0;
$compressed_js_filename = '';
 
// get js files infos
foreach ($js_files as $filename)
{
$infos = array();
$infos['uri'] = $filename;
$url_data = parse_url($filename);
$infos['path'] =_PS_ROOT_DIR_.str_replace(__PS_BASE_URI__, '/', $url_data['path']);
$js_files_infos[] = $infos;
 
$js_files_date = max(
file_exists($infos['path']) ? filemtime($infos['path']) : 0,
$js_files_date
);
$compressed_js_filename .= $filename;
}
Link to comment
Share on other sites

Ok,

le problème vient du module blockstore  (qui ne devait pas être activé avant ?)

dans /modules/blockstore/blockstore.php trouvez la fonction suivante:

	function hookHeader($params)
	{
		Tools::addCSS(_THEME_CSS_DIR_.'modules/'.$this->name.'/blockstore.css', 'all');
	}

et remplacez-là par :

	public function hookHeader($params)
	{
		Tools::addCSS($this->_path.'blockstore.css', 'all');
	}

:)

Link to comment
Share on other sites

Merci en effet ca fonctionne impecable maintenant en vous remerciant beaucoup je commence a decouvrir prestashop et je suis ravis d'avoir eu de l'aide aussi rapidement merci encore.Je ne sais pas si il etait activé avant en faite car j'ai bidouillé pas mal au début car j'avai pas mal d'erreur

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...