Zend FR

Consultez la FAQ sur le ZF avant de poster une question

Vous n'êtes pas identifié.

#1 27-01-2010 13:47:43

elec
Membre
Date d'inscription: 16-10-2009
Messages: 118

Le dossier "Public"

Bonjour j'ai une petite question en ce qui concerne l'arborescence pour zend, je souhaite changer "http://localhost/Porjet/public/index/index " par  "http://localhost/Projet/index/index",après une petite expérience avec ce framework je pense que c'est un problème sans solution par l'importance du dossier "Public" mais malgré tout je souhaite votre aide,en plus je ne cherche pas à utiliser Zend_route pour chaque page et c'est ici la difficulté.

Quand je déplace mon "index.php" et ".htaccess" du dossier "Public "au "/Projet " il m'affiche cette erreur :

Code:

Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\Projet\index.php on line 18

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path=';.;C:\php5\pear') in C:\wamp\www\Projet\index.php on line 18

Bien sur il ne connait pas le chemin vers librairie et voilà mon "index.php" :

Code:

<?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();

Merci.Nll

Dernière modification par elec (27-01-2010 13:49:17)

Hors ligne

 

#2 27-01-2010 14:15:06

ndesaleux
Membre
Date d'inscription: 16-04-2007
Messages: 196
Site web

Re: Le dossier "Public"

Changes ta config apache (voir les virtual host/alias/etc.)

Hors ligne

 

#3 27-01-2010 15:05:46

StefC30
Membre
Date d'inscription: 28-03-2008
Messages: 35

Re: Le dossier "Public"

En effet, il suffit de définir l'alias de ton site "Projet" directement sur le répertoire Public dans le fichier de configuration du serveur Apache. De ce fait, tu pourras avoir l'URL : "http://localhost/Projet/index/index".

Exemple dans le httpd.conf :

Code:

<Directory "C:\www\Projet\public">
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>
Alias /Projet "C:\www\Projet\public"

Et un petit RewriteBase dans ton fichier .htaccess :

Code:

SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteBase /Projet/
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

@+

Stéphan.

Dernière modification par StefC30 (27-01-2010 15:09:41)

Hors ligne

 

#4 27-01-2010 18:59:00

elec
Membre
Date d'inscription: 16-10-2009
Messages: 118

Re: Le dossier "Public"

Bonsoir,

Oui,merci pour vos réponse,c'est vraiment cela la solution que je cherche.Merci.


A+.Nll

Hors ligne

 

#5 28-06-2010 17:10:15

Levan
Nouveau membre
Date d'inscription: 28-06-2010
Messages: 9

Re: Le dossier "Public"

Bonjour,

je voulais savoir si la création de mon vhost était correct?
<VirtualHost *:80>
    DocumentRoot "C:/Program Files/Zend/Apache2/htdocs/quickstart/public"
    ServerName quickstart.locale
    ErrorLog  "/error/error.log"
       
    <Directory "C:/Program Files/Zend/Apache2/htdocs/quickstart/public/">
        Options Indexes FollowSymlinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    SetEnv APPLICATION_ENV development
   
</VirtualHost>

J'ai déclare dans le etc/host 127.0.0.1 quickstart.locale

Par contre j'arrive bien à aller sur l'index mais des que j'essaye de faire quickstart.locale/guestbook j'obtiens une erreur 404

Merci

Hors ligne

 

Pied de page des forums

Propulsé par PunBB
© Copyright 2002–2005 Rickard Andersson
Traduction par punbb.fr

Graphisme réalisé par l'agence Rodolphe Eveilleau
Développement par Kitpages