héberger un site web Cakephp

Par flinstone, il y a 12 ans


Bonjour,
est-ce que c'est normal d'avoir une page intitulé Errors (dont 2 images s'affichent) lors de l'hébergement d'un site cakephp ??!
j'ai modifié mes fichiers .htaccess pas mal de fois mais toujours le problème est le même !!
de l'aide SVP.

25 réponses

Grafikart, il y a 12 ans

Non :D
Tu as des logs sur ton hébergement ?

flinstone, il y a 12 ans

Non !!

flinstone, il y a 12 ans

j'ai essayé cette manip topic 9547 mais ça n'a pas marché !!

flinstone, il y a 12 ans

Apparemment y a pas de solution à ce problème !! de plus j'ai trouvé que pas mal de gens ont le même problème que moi dans d'autres forums et aussi pas de réponses convaincantes !!!

antho07, il y a 12 ans

Bonjour ton hébergeur a-t-il l'url rewriting activé?

flinstone, il y a 12 ans

Oué!

antho07, il y a 12 ans

y'as pas un soucis de virtualhost...
essaye dans les 2 .htaccess de rajouter cette ligne

<if module truc>
RewriteBase /
..] 
</if module>
antho07, il y a 12 ans

En clair le premier .htaccess (celui dans le dossier du site) :

<IfModule mod_rewrite.c>
   RewriteBase /
   RewriteEngine on
   RewriteRule ^$ app/webroot/ [L]
   RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

et le deuxieme (dans app)

<IfModule mod_rewrite.c>
    RewriteBase /
    RewriteEngine on
    RewriteRule ^$ webroot/ [L]
    RewriteRule (.*) webroot/$1 [L]
</IfModule>
flinstone, il y a 12 ans

Toujours le même problème :

Class 'AuthComponent' not found in ..

(je suis proche de renoncer --')

antho07, il y a 12 ans

not found in quoi ??

antho07, il y a 12 ans

en informatique c'est essentiel d'être patient, faut rester calme et chercher d'où le problème vient

flinstone, il y a 12 ans

dans : app/View/Elements/public_menu_top.ctp
(cela fait deux semaines que je galère !!)

antho07, il y a 12 ans

En local tout marche??

On peut avoir le code de cet élement?

antho07, il y a 12 ans

T'as bien le composant Auth chargé dans l'AppController?

flinstone, il y a 12 ans

évidement en local tout va bien.

<div class="entete">
    <div class="row">
        <div class="span3">
            <?php echo $this->Html->image('logoEcole.jpg', array(
                'id' => 'logoEcole',
                'alt' => 'Ecole xxx',
                'title' => 'logo'
            )); ?>
        </div>
        <div class="span6">
            <?php echo $this->Html->image('slogan.jpg', array(
                'id' => 'slogan',
                'alt' => 'slogan ecole xxx',
                'title' => 'slogan'
            )); ?>
            <nav class="nav-menu">
                <ul>
                    <li><?php echo $this->Html->link('Accueil', array('controller'=> 'actualites', 'action' => 'index', 'membre' => false)); ?></li>
                    <li><?php echo $this->Html->link('Présentation', array('controller'=> 'presentations', 'action' => 'index', 'membre' => false)); ?></li>
                    <li><?php echo $this->Html->link('Espace parents', array('controller'=> 'notices', 'action' => 
                    'index', 'membre' => true)); ?></li>
                    <!-- <li><a href="#">Galerie</a></li> -->
                    <li><?php echo $this->Html->link('Contact', array('controller'=> 'contacts', 'action' => 'index', 'membre' => false)); ?></li>
                    <?php
                        if(AuthComponent::user('id') && (AuthComponent::user('role') === 'admin' || AuthComponent::user('role') === 'directeur' || AuthComponent::user('role') === 'superadmin') 
                            && AuthComponent::user('actif') == 1){ ?>
                            <li><?php echo $this->Html->link('Administration', array('controller'=> 'users', 'action' => 'index', 'admin' => true)); ?></li>
                        <?php } ?>
                </ul>
            </nav>
        </div>
        <div class="span2">
            <?php echo $this->Html->image('logoMinistere.gif', array(
                'id' => 'logoMinistere',
                'alt' => 'logo ministère de l\'éducation xxx',
                'title' => 'ministère de l\'éducation'
            )); ?>
        </div>
    </div>
</div>
flinstone, il y a 12 ans

la seconde image ne s'affiche pas !!

Kareylo, il y a 12 ans

T'as essayé avec le helper de Session ?

<?php
if($this->Session->read('Auth.User.id') && ($this->Session->read('Auth.User.role') === 'admin' || 
$this->Session->read('Auth.User.role') === 'directeur' || $this->Session->read('Auth.User.role') === 'superadmin') &&
 $this->Session->read('Auth.User.actif') == 1){ ?>
     <li><?php echo $this->Html->link('Administration', array('controller'=> 'users', 'action' => 'index', 'admin' => true)); ?></li>
<?php } ?>
flinstone, il y a 12 ans

Merci bcp Kareylo ça a marché <u><strong>mais</strong></u> maintenant on ne connaît aucun de mes Controllers :

..app/webroot/index.php(96): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))

une idée SVP !!

flinstone, il y a 12 ans

Je pense que c'est le rewrite qui ne fonctionne plus correctement !!
mais que faire ?!

flinstone, il y a 12 ans
Error: [MissingControllerException] Controller class EcoleController could not be found.

le problème c'est que y a pas de controller Ecole dans mon site !!

antho07, il y a 12 ans

Comme ça ça va être dur par forum.. ta skype?

flinstone, il y a 12 ans

@antho07: mon hébergeur est hebergratuit

antho07, il y a 12 ans

Je vois pas d'explication ou de détails sur les modules apache chargés....:s

flinstone, il y a 12 ans

@antho07: donc.. ?!
pour un autre hébergeur (Hostinger) voici ce que m'affiche le site:

<?php
/**
 * Index
 *
 * The Front Controller for handling every request
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link http://cakephp.org CakePHP(tm) Project
 * @package app.webroot
 * @since CakePHP(tm) v 0.2.9
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * Use the DS to separate the directories in other defines
 */
    if (!defined('DS')) {
        define('DS', DIRECTORY_SEPARATOR);
    }
/**
 * These defines should only be edited if you have cake installed in
 * a directory layout other than the way it is distributed.
 * When using custom settings be sure to use the DS and do not add a trailing DS.
 */
/**
 * The full path to the directory which holds "app", WITHOUT a trailing DS.
 *
 */
    if (!defined('ROOT')) {
        define('ROOT', dirname(dirname(dirname( __FILE__ ))));
    }
/**
 * The actual directory name for the "app".
 *
 */
    if (!defined('APP_DIR')) {
        define('APP_DIR', basename(dirname(dirname( __FILE__ ))));
    }
/**
 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
 *
 * Un-comment this line to specify a fixed path to CakePHP.
 * This should point at the directory containing `Cake`.
 *
 * For ease of development CakePHP uses PHP's include_path. If you
 * cannot modify your include_path set this value.
 *
 * Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
 */
    //define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
/**
 * Editing below this line should NOT be necessary.
 * Change at your own risk.
 *
 */
    if (!defined('WEBROOT_DIR')) {
        define('WEBROOT_DIR', basename(dirname( __FILE__ )));
    }
    if (!defined('WWW_ROOT')) {
        define('WWW_ROOT', dirname( __FILE__ ) . DS);
    }
    if (!defined('CAKE_CORE_INCLUDE_PATH')) {
        if (function_exists('ini_set')) {
            ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
        }
        if (!include('Cake' . DS . 'bootstrap.php')) {
            $failed = true;
        }
    } else {
        if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
            $failed = true;
        }
    }
    if (!empty($failed)) {
        trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
    }
    if (isset($_SERVER'PATH_INFO']) && $_SERVER'PATH_INFO'] == '/favicon.ico') {
        return;
    }
    App::uses('Dispatcher', 'Routing');
    $Dispatcher = new Dispatcher();
    $Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
flinstone, il y a 12 ans

En renommant mes contrôleurs (ex: absencesController.php ==> A bsencesController.php j'ai réglé le problème --'
quel ... !!