7
votes

I Have tried to integrate a symfony project on my server but it produces a blank page does not produce any errors even if i on the error display in php. After i include configuration file in index.php nothing works, even the die in the first line of project configuration file does not print when i try this.

My index.php file is

error_reporting(E_ALL);

    ini_set('display_errors', "1");

    require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');

    $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', false);
    sfContext::createInstance($configuration)->dispatch();

i am including the project configuration file also here please check that also

require_once dirname(__FILE__).'/../lib/symfony/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
      {
        // ...

        $this->dispatcher->connect('request.filter_parameters', array($this, 'filterRequestParameters'));
      }

      public function filterRequestParameters(sfEvent $event, $parameters)
      {
        $request = $event->getSubject();
        if (preg_match('|Safari/([0-9\.]+)|', $request->getHttpHeader('User-Agent')))
        {
          $request->setRequestFormat('html');
        }

        return $parameters;
      }
}

i have included the symfony folder inside the lib folder of the project.

It does not produce any error even i tried it in development mode also please not that i have provide full permission to all files including cache and log folder.

2
Have you tryed accessing that page with the dev controler? the one using the dev environment? something like <yourappname>_dev.php/<module>/<action>?cernunnos
Check your error log files, you almost certainly have a syntax error or some other syntax error, like a failed require. A syntax error will not show on the screen if display_errors is disabled in php.ini.DaveRandom
The problem is it is not producing any log messages on any log file. Also i have already enable display errors on php.ini. I don't know what happend really actually even a die not working in ProjectConfiguration file. Anyway thanks.anoop
Does it return a 200 or 500 response?Michal Trojanowski
Have you checked if any php file works from the Sf web folder? Like make a test.php with a simple echo or php_info. If it doesn't work it's definitely Apache's config error, not an Sf problem. Have you checked the Apache error logs?Michal Trojanowski

2 Answers

4
votes

Set permission to cache and log folder

chmod 777 cache/ log/ -R
php symfony cc
0
votes

It also happened to me once, I created a route /media and this route given a white page.

After a quite long while, I realized that /media was also an existing asset directory. The asset dir had the priority.