Bonjour,
j'ai accès à un ovh pro.
afin de tester l'installation et configuration je voudrais rendre accessible la partie demo
j'ai donc détaré le symfony 2.0.8 à l'intérieur de la façon suivante :
home.XXX/monlogin/www/.htaccess
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 / ___app ___bin ___src ___www deps deps.block LICENCE README.md
home.XXX/monlogin/www/app.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 SetEnv PHP_VER 5_3 SetEnv SHORT_OPEN_TAGS 0 SetEnv REGISTER_GLOBALS 0 SetEnv MAGIC_QUOTES 0 SetEnv SESSION_AUTOSTART 0 SetEnv ZEND_OPTIMIZER 1 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L] </IfModule>
passage du false à true pour AppKernel
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <?php require_once __DIR__.'/../app/bootstrap.php.cache'; require_once __DIR__.'/../app/AppKernel.php'; //require_once __DIR__.'/../app/AppCache.php'; use Symfony\Component\HttpFoundation\Request; $kernel = new AppKernel('prod', true); $kernel->loadClassCache(); //$kernel = new AppCache($kernel); $kernel->handle(Request::createFromGlobals())->send();
test
http://www.monsite.com/app.php/demo/hello/World
j'obtiens
Test en dev
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 No route found for "GET /demo/hello/World" 404 Not Found - NotFoundHttpException 1 linked Exception: ResourceNotFoundException »
modification en enlevant le "!"
if (!n_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
)))
http://www.monsite.com/app_dev.php/demo/hello/World
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?php // if you don't want to setup permissions the proper way, just uncomment the following PHP line // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information //umask(0000); // this check prevents access to debug front controllers that are deployed by accident to production servers. // feel free to remove this, extend it, or make something more sophisticated. if (n_array(@$_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '::1', ))) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); } require_once __DIR__.'/../app/bootstrap.php.cache'; require_once __DIR__.'/../app/AppKernel.php'; use Symfony\Component\HttpFoundation\Request; $kernel = new AppKernel('dev', true); $kernel->loadClassCache(); $kernel->handle(Request::createFromGlobals())->send();
fonctionne et affiche Hello World
Que manque-t-il pour faire fonctionner
Merci
Partager