23

Why am I getting:

Warning: ob_start(): function '' not found or invalid function name in /symfony-1.3\lib\config\sfApplicationConfiguration.class.php on line 155

This occurs with Symfony 1.x projects. I am using Apache 2.2 and PHP 5.4.1.

The mentioned line has:

ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');
4

3 回答 3

55

Try using a null value instead of the empty string.

ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : null);
于 2012-04-30T09:01:15.003 回答
3

-ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');

+ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : null);

于 2013-08-19T15:02:40.460 回答
0

This was fixed in symfony 1.4.16

See symfony 1.4.16 changelog:

  • [...]
  • [33214] fixed ob_start() behavior on CLI (closes #9970)
  • [33208] fixed ob_start usage (to avoid warning in PHP 5.4, closes #9970)

So simply make sure to use at least that version.

Preferably use the latest/last/final symfony 1.x version released, which is 1.4.20.

You can grab them at the official Git mirror for symfony 1.x .

于 2018-02-13T09:14:41.153 回答