简体   繁体   English

Slim3 Twig2空白页-OVH服务器

[英]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). 在生产环境(OVH服务器)上运行应用程序时,在使用Slim3 + Twig2 + PHP 7.2时出现空白页。 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) 我正在使用php 7.2(并已在以前的版本中尝试过)并获得200返回的http代码(使用Chrome /开发工具/网络)

Try doing killing the script with die() ; 尝试使用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 . 如果仍然显示空白页,请检查定义$app$container的php文件中是否存在错误。 Hope that you can do something with this answer. 希望您可以用这个答案做些什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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