Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour,
J'essaie en vain de configurer Zend FrameWord sur un serveur apache mutualise de mon fournisseur d'acces (erreur 404 ne trouve pas index.php). Voici l'arborescence que j'utilise ainsi que les differents fichiers. Peut-etre que quelqu'un a une idee pour debloquer la situation. D'avance merci :
.htaccess
AddHandler php5-fastcgi php
RewriteEngine on
AuthUserFile "/home/allain/.htpasswds/public_html/passwd"
RewriteCond %{HTTP_HOST} ^bangbang.biz.pl$ [OR]
RewriteCond %{HTTP_HOST} ^www.bangbang.biz.pl$
RewriteRule ^/?$ "http\:\/\/www\.bangbang\.biz\.pl\/bangbang\/strona_glowna\-11\-s\.html" [R=301,L]
Options All Indexes
IndexOptions FancyIndexing
RewriteCond %{HTTP_HOST} ^termobaltyk.com.pl$ [OR]
RewriteCond %{HTTP_HOST} ^www.termobaltyk.com.pl$
RewriteRule ^/?$ "http\:\/\/www\.termobaltyk\.com\.pl\/public" [R=301,L]
\termobaltyk
\application
bootstrap.php
<?php
// Configure the site environment status.
defined('APPLICATION_ENVIRONMENT')
or define('APPLICATION_ENVIRONMENT', 'development');
// Invoke the front controller
$frontController = Zend_Controller_Front::getInstance();
// Identify the location of the controller directory
$frontController->setControllerDirectory(APPLICATION_PATH . '/controllers');
// Create the env parameter so you can later access the environment
// status within the application.
$frontController->setParam('env', APPLICATION_ENVIRONMENT);
// Clean up allocated script resources
unset($frontController);
\configs
\controllers
IndexController.php
\views\
\scripts
\index
index.phtml
<h1>Welcome to GameNomad!</h1>
<p>Total games in database: <?php echo $this->gameCount; ?></p>
\library
\public
\css
\images
\javascripts
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
index.php
<?php
// Identify the location of the application directory in respect to
// the bootstrap file's location, and configure PHP's include_path to
// include the library directory's location
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/'));
set_include_path(
APPLICATION_PATH . '/../library'. PATH_SEPARATOR . get_include_path()
);
// Give the Zend Framework the ability to load classes on demand,
// as you request them, rather than having to deal with require() statements.
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
// Retrieve the bootstrap.php file
try {
require '../application/bootstrap.php';
} catch (Exception $exception) {
printf("Could not locate bootstrap.php");
exit(1);
}
// Start using the front controller in order to route URL requests
Zend_Controller_Front::getInstance()->dispatch();
Hors ligne
Malheureusement, tu ne peux probablement pas changer la racine du serveur pour ton site.
La solution est dans le htaccess...je suis PAS un expert htaccess mais voici un .htaccess que j'ai du utiliser pour un projet dans un environnement semblable au tient. Il est loin d'être parfait niveau sécurité...
Vérifie si tu le rewriteEngine est bien activité sur le serveur également, sinon, impossible:
RewriteEngine On RewriteRule ^\.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /public/index.php [NC,L] RewriteCond %{REQUEST_URI} !^/public/.*$ RewriteRule ^(.*)$ /public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.*$ - [NC,L] RewriteRule ^public/.*$ /public/index.php [NC,L]
Hors ligne
Rob Allen a aussi fait un tutoriel sur le sujet : Rob Allen's Dev notes - Zend Framework on a shared host (en).
Bonne chance !
Hors ligne
Je vous remercie pour vos suggestions.
Hors ligne
Pages: 1