PHP Warning “Warning: ob_start(): function '' not found or invalid function name” in Symfony 1?

拈花ヽ惹草 提交于 2020-01-22 13:13:29

问题


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' : '');

回答1:


Try using a null value instead of the empty string.

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



回答2:


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

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




回答3:


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 .



来源:https://stackoverflow.com/questions/10380932/php-warning-warning-ob-start-function-not-found-or-invalid-function-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!