diff --git a/cosmogramme/php/_init.php b/cosmogramme/php/_init.php
index 0fa68bd7c75aa3f49931e83196e375fa82f96550..c72d73fb8096e6e7777584edca4fa4964eb42671 100644
--- a/cosmogramme/php/_init.php
+++ b/cosmogramme/php/_init.php
@@ -3,11 +3,9 @@
 define("VERSION_COSMOGRAMME","6.31");
 define("PATCH_LEVEL","156");
 define("APPLI","cosmogramme");
+define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs");
 define("CRLF", chr(13) . chr(10));
 define("BR","<br />");
-define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs");
-
-
 
 if (!function_exists('xdebug_break')) {
 	function xdebug_break(){};
@@ -37,14 +35,17 @@ define("URL_IMG", URL_BASE ."images/");
 // Includes
 set_include_path(get_include_path().PATH_SEPARATOR.'./php/' . PATH_SEPARATOR . "./php/classes/");
 
-require("classe_sql.php");
-require("fonctions/sql.php");
 require("fonctions/fonctions_base.php");
 require("fonctions/string.php");
 require("fonctions/erreur.php");
 require("fonctions/date_heure.php");
 require("fonctions/variables.php");
+
 require_once(realpath(dirname(__FILE__)).'/../storm_init.php');
+
+require("classe_sql.php");
+require("fonctions/sql.php");
+
 // Lire la config
 $cfg=lireConfig($cfgfile);
 
diff --git a/cosmogramme/storm_init.php b/cosmogramme/storm_init.php
index 148f9fdfe0b89c2e4253a0aa03a4f1d7520ce34c..7879eb112c094a8852d650d0f2a3a01dcfdb6e88 100644
--- a/cosmogramme/storm_init.php
+++ b/cosmogramme/storm_init.php
@@ -1,51 +1,55 @@
 <?php 
 
-/**
- * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
- *
- * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
- * the Free Software Foundation.
- *
- * There are special exceptions to the terms and conditions of the AGPL as it
- * is applied to this software (see README file).
- *
- * AFI-OPAC 2.0 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
- * along with AFI-OPAC 2.0; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA 
- */
-
+  /**
+   * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
+   *
+   * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
+   * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
+   * the Free Software Foundation.
+   *
+   * There are special exceptions to the terms and conditions of the AGPL as it
+   * is applied to this software (see README file).
+   *
+   * AFI-OPAC 2.0 is distributed in the hope that it will be useful,
+   * but WITHOUT ANY WARRANTY; without even the implied warranty of
+   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+   *
+   * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
+   * along with AFI-OPAC 2.0; if not, write to the Free Software
+   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA 
+   */
 include_once (realpath(dirname(__FILE__)).'/local.php');
-if (!defined('OPAC_PATH'))
-	define('OPAC_PATH',realpath(dirname(__FILE__).'/../'));
 
-if (!defined('ZEND_FRAMEWORK_PATH'))
-	define ('ZEND_FRAMEWORK_PATH', PATH_SEPARATOR . '../../ZendFramework-1.6.2/library');
+if (!defined('OPAC_PATH'))
+  define('OPAC_PATH',realpath(dirname(__FILE__).'/../'));
 
+if (!defined('LANG_DIR'))
+  define('LANG_DIR', OPAC_PATH.'/library/translation/');
 
-set_include_path(
-	ZEND_FRAMEWORK_PATH
-	. PATH_SEPARATOR . get_include_path()
-	. PATH_SEPARATOR.OPAC_PATH . '/library'
-);
+set_include_path(get_include_path().PATH_SEPARATOR.OPAC_PATH.'/library');
 
 // Includes de base
 include_once "fonctions/array.php";
 include_once OPAC_PATH."/local.php";
 
+if (!defined('ZEND_FRAMEWORK_PATH'))
+  define ('ZEND_FRAMEWORK_PATH', PATH_SEPARATOR . '../../ZendFramework-1.6.2/library');
+
+set_include_path(ZEND_FRAMEWORK_PATH.PATH_SEPARATOR.get_include_path());
+
 require_once "Zend/Loader.php";
 require_once "startup.php";
 Zend_Loader::registerAutoload();
 
-$cfg_file = file_exists('../config.ini') ? '../config.ini' : OPAC_PATH.'/config.ini';
+$base_dir = $_SERVER['DOCUMENT_ROOT'].'/'.explode('/', $_SERVER['SCRIPT_NAME'])[1];
+if (!file_exists($cfg_file = $base_dir.'/config.ini')) {
+  $cfg_file = file_exists('../config.ini') ? '../config.ini' : OPAC_PATH.'/config.ini';
+}
+
 $cfg = loadConfig($cfg_file);
 setupDatabase($cfg);
 setupDevOptions($cfg);
-defineConstant('LANG_DIR', realpath(dirname(__FILE__)).'/../library/translation/');
+
 setupLanguage();
 ?>
\ No newline at end of file