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

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


Try using a null value instead of the empty string.

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


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

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


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 .