简体   繁体   中英

Slim3 Twig2 Blank Page - OVH server

I have a blank page when using Slim3 + Twig2 + PHP 7.2 when I run the application on production (OVH server). I'have been looking for any answer to my problem, but none of what I have found corrected it...


Thanks for your answer.

Here is my code in one of my controller :

function getAccueil($request, $response, $args = array(NULL))
{

    if (empty($args))
    {
        $args['lang'] = 'fr';
    }

    $lang = $args['lang'];
    $fr_url = '/fr.html';
    $en_url = '/en.html';

    return  $this->view->render($response, 'accueil.twig',  array(
        'lang' => $args['lang'],
        'fr_url' => $fr_url,
        'en_url' => $en_url,
    ));
}

I'm using php 7.2 (and already tried with previous versions) and get a 200 return http code (using Chrome/Devlopment tools/Network)

Try doing killing the script with die() ; before returning the twig renderer. If it still gives a blank page maybe check if something is wrong in the php file where you define your $app and $container . Hope that you can do something with this answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM