Warning: ob_start(): function ” not found or invalid function name Symfony

If you are installing a symfony 1.x project on a PHP 5.4.1 (or later) version, you may encounter this warning message :
Warning: ob_start(): function ” not found or invalid function name in /var/www/lib/config/sfApplicationConfiguration.class.php on line 157 Notice: ob_start(): failed to create buffer in /var/www/lib/config/sfApplicationConfiguration.class.php on line 157

To fix it, go on your /lib/config/sfApplicationConfiguration.class.php file and change this

// compress output
    if (!self::$coreLoaded)
    {
      ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');
    }

to this

// compress output
    if (!self::$coreLoaded)
    {
      ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : null);
    }

Leave a Reply