Re: Problem with output_buffering directive in cli

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 10, 2008 at 10:27 PM, Mike Burba <mike.burba@xxxxxxxxx> wrote:

> I am using Smarty templates to format HTML emails from the command
> line (using cli).  My typical command is:
> php filename.php
>
> However, and I am struggling with templates that are greater than 10k.
>  It looks like the Smarty output is getting truncated at about 10k.
> Smarty uses output_buffering, so I need to be set the output_buffering
> directive to "1" or "On" or "1000000", or something other than "Off".
> But I have not been able to do that.
>
> I have changed the output_buffering setting in /.../cli/php.ini (as
> well as /.../apache2/php.ini & /.../cgi/php.ini for good measure).
> And that does seem to have an effect.
>
> Here is what the output from phpinfo() is from the command line:
> Directive => Local Value => Master Value
> ....snip...
> output_buffering => 0 => 1000000
> output_handler => no value => no value
> ...snip...
>
> So in other words, when I change the value in my /.../cli/php.ini, the
> "Master Value" changes. However, the "Local Value" stays at "0".
>
> In my code, I am testing for the value of output_buffering (using
> ini_get("output buffering")),


dunno if this was a typo on your part, but shouldnt it be,
ini_get("output_buffering") ?


> and its value is always "0" (same as the
> "Local Value" that is output from the phpinfo().
>
> So my question is...how do I turn on output_buffering correctly from
> the command line?  Am I configuring the /.../cli/php.ini file
> correctly?  Is something in my code (maybe an included library) maybe
> setting that value without me knowing?  Am I looking in the wrong
> place / headed in the wrong direction?


you might not be getting your settings from the ini file you think you are,
or there could be another one in the way.  just for the hell of it, why not
give

php --ini

a shot, see if something unexpected crops up, and maybe poke around in all
of those files.

also, this brings up the point of setting local values on the cli.  im not
sure how to do it.  w/ apache, you can supply a .htaccess file which allows
you to alter values in the 'local' column of the phpinfo() output.  anyone
know how to do it on the cli ?

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux