Changing php.ini file on server

V

vtupser

Guest
Does anyone know the command line to change the output_buffering directive in the php.ini file by using either the ini_set() function in a php file or using a .htaccess file? The hosting company server that I use has that directive set to 'no value' and I need it to be turned on/set to a certain character size. They seem to not know what I am talking about, so I was checking to see if I could do it through ini_set() or .htaccess. I do not have access to the php.ini file myself since I am using a shared hosting plan and not a dedicated server.
 
OP
L

lil

Guest
vtupser said:
Does anyone know the command line to change the output_buffering directive in the php.ini file by using either the ini_set() function in a php file or using a .htaccess file? The hosting company server that I use has that directive set to 'no value' and I need it to be turned on/set to a certain character size. They seem to not know what I am talking about, so I was checking to see if I could do it through ini_set() or .htaccess. I do not have access to the php.ini file myself since I am using a shared hosting plan and not a dedicated server.

You should be able to do this (you may have already tried)

This will test the current value:

<?php

$oldsetting=ini_get('output_buffering');

echo "The old setting is $oldsetting <br>";

?>


To change it do a:

<?php

$oldsetting=ini_set('output_buffering',On); // or to the level of bytes of buf'r
$newsetting=ini_get('output_buffering);

echo "The OLD setting was: $oldsetting and the NEW setting is now: $newsetting.<br>";

?>


Not wishing to perhaps teach you to suck eggs but output buffering is a variable that is so-called PHP_INI_PERDIR which means you can change the setting in php.ini (for a global setting over your server) or in the .htaccess or httpd.conf files when using apache for a per directory setting of this variable.

However how you do the latter for httpd.conf and php.ini I am not sure. I would be sure php.net or perhaps a search on apache, php.ini, .htaccess may avail some answers if you need this on a per dir setting.

Try the ini_set method first though to make sure that works.

Hope this helps you!

Vicky :flower:
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top