Précédent   Forum des professionnels en informatique > PHP > Outils > Zend > Zend Framework
Zend Framework Forum d'entraide sur la programmation PHP avec Zend Framework. Avant de poster -> FAQ ZF, Cours ZF
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 12/03/2011, 21h21   #1
Candidat au titre de Membre du Club
 
Inscription : mai 2007
Messages : 65
Détails du profil
Informations forums :
Inscription : mai 2007
Messages : 65
Points : 12
Points : 12
Par défaut Impossible d'acceder à un contrôleur

Bonjour,

J'essaie actuellement Zend en suivant le tutoriel : http://s-jdm.developpez.com/tutoriel...end-framework/ et ça fonctionne correctement.

Maintenant j'essaie de créer un nouveau contrôleur "ComptesController" mais quand j'essaie d'aller sur une adresse du type : http://localhost/tutoriel-zf/public/comptes/index ça me met une erreur 404. Pourtant http://localhost/tutoriel-zf/index/index ou http://localhost/tutoriel-zf/index/create tout fonctionne très bien.

J'ai fait des recherches sur internet et je ne voie pas ce qui cloche.

Voici mon public/.htaccess
Code :
1
2
3
4
5
6
7
 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Voici mon fichier de conf pour apache :
Code :
1
2
3
4
5
6
7
8
 
	Alias /tutoriel-zf/ /home/dougui/workspace/Zend/tutoriel-zf/
	<Directory /home/dougui/workspace/Zend/tutoriel-zf/>
        	Options Indexes MultiViews FollowSymLinks
        	AllowOverride None
        	Order deny,allow
        	Allow from all
	</Directory>
Mon fichier public/index.php
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
<?php
 
// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
 
// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
 
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));
 
/** Zend_Application */
require_once 'Zend/Application.php';
 
// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();
et mon fichier application/Bootstrap.php

Code :
1
2
3
4
5
6
7
8
9
10
11
12
 
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	protected function _initAutoload()
	{
		$moduleLoader = new Zend_Application_Module_Autoloader(array(
			'namespace' => '',
			'basePath' => APPLICATION_PATH));
		return $moduleLoader;
	}
}
Quelqu'un peut m'aider?

Merci d'avance.
Dougui_bzh est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/03/2011, 22h05   #2
Membre du Club
 
Inscription : août 2007
Messages : 169
Détails du profil
Informations forums :
Inscription : août 2007
Messages : 169
Points : 50
Points : 50
Bonjour ,
je crois l'url juste est
Code :
1
2
 
http://localhost/tutoriel-zf/comptes/index
sans public
van-bom est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/03/2011, 23h24   #3
Candidat au titre de Membre du Club
 
Inscription : mai 2007
Messages : 65
Détails du profil
Informations forums :
Inscription : mai 2007
Messages : 65
Points : 12
Points : 12
J'ai résolu mon problème en créant un VirtualHost avec apache. Mon problème était due à l'url rewriting. Merci pour ton aide.
Dougui_bzh est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 19h42.


 
 
 
 
Partenaires

Hébergement Web