Page 1 sur 1

Visualisation d'un site en local avec Composer

Posté : 14 juil. 2016, 16:51
par easybeau
Bonjour. J'ai installé le cms grav https://getgrav.org/ en local. Il dépend de Composer qui a été installé avec succès. Dans le browser http://localhost, j'obtiens une page blanche avec ce texte :
bin/grav install"); } use Grav\Common\Grav; // Register the auto-loader. $loader = require_once $autoload; if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) { throw new \RuntimeException(sprintf('You are running PHP %s, but Grav needs at least PHP %s to run.', $ver, $req)); } // Set timezone to default, falls back to system if php.ini not set date_default_timezone_set(@date_default_timezone_get()); // Set internal encoding if mbstring loaded if (!extension_loaded('mbstring')) { throw new \RuntimeException("'mbstring' extension is not loaded. This is required for Grav to run correctly"); } mb_internal_encoding('UTF-8'); // Get the Grav instance $grav = Grav::instance( array( 'loader' => $loader ) ); // Process the page try { $grav->process(); } catch (\Exception $e) { $grav->fireEvent('onFatalException'); throw $e; }
Je ne comprends pas, il manque l'architecture du site.
Cordialement.

Re: Visualisation d'un site en local avec Composer

Posté : 14 juil. 2016, 17:08
par or 1
un simple code
<?php echo "test"; ?>
fonctionne ?

Re: Visualisation d'un site en local avec Composer

Posté : 14 juil. 2016, 17:24
par easybeau
Merci pour votre message. J'ai accès à l'url http://localhost et cela fonctionne. J'ai le message : It works!. Par contre je n'ai plus accès au dossier /public. Message :
Forbidden
You don't have permission to access /public/ on this server. Je crois qu'il y a un problème avec les répertoires de sites. Il ne trouve pas non plus mon fichier test.php.

Re: Visualisation d'un site en local avec Composer

Posté : 14 juil. 2016, 18:46
par easybeau
Par exemple pour monsite1, j'ai la page suivante qui s'affiche :

--- layout: default ---
Posts

{% for post in site.posts %}
{{ post.date | date: "%b %-d, %Y" }}
{{ post.title | escape }}
{% endfor %}

subscribe via RSS

Re: Visualisation d'un site en local avec Composer

Posté : 14 juil. 2016, 18:57
par easybeau
Pour répondre à votre question, oui le simple code <?php echo "test"; ?> fonctionne.