By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

How do you find the value of LimitRequestBody using PHP?

P: n/a
In /etc/httpd/conf.d/php.conf there is a line that limits the size of
$_REQUEST to a byte size that, when shipped with PHP, comes to approx
524K, however, that amount can be changed.

How can you use PHP to determine the size of LimitRequestBody in
advance? I need that for my application as the user will need to know
the absolute limit of what they can upload at one time via PHP.

Thanx
Phil
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Phil Powell" <so*****@erols.com> wrote...
How can you use PHP to determine the size of LimitRequestBody in
advance? I need that for my application as the user will need to know
the absolute limit of what they can upload at one time via PHP.


Hi Phil,

Take a look at:
http://us4.php.net/manual/en/function.get-cfg-var.php
and
http://us4.php.net/manual/en/function.ini-get.php

Have a great day!

Ben :-)
Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16
Jul 17 '05 #2

P: n/a
Sorry, both of these failed to produce a result:

get_cfg_var('LimitRequestBody');

ini_get('LimitRequestBody');

From what I see in the manual, ini_get() only gets from php.ini;
get_cfg_var() gets from all config PHP files.

Which in both cases will fail miserably because the value of
LimitRequestBody is only found in /etc/httpd/conf.d/php.conf and can
be altered by the admin which would produce a false result in
get_cfg_var() unless the admin were to bounce the server to repopulate
with the current value.

:(

Phil

"Ben Gribaudo" <bengribaudoN_O_@_S_P_A_Mverizon.net> wrote in message news:<%v*****************@nwrddc03.gnilink.net>...
"Phil Powell" <so*****@erols.com> wrote...
How can you use PHP to determine the size of LimitRequestBody in
advance? I need that for my application as the user will need to know
the absolute limit of what they can upload at one time via PHP.


Hi Phil,

Take a look at:
http://us4.php.net/manual/en/function.get-cfg-var.php
and
http://us4.php.net/manual/en/function.ini-get.php

Have a great day!

Ben :-)
Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16

Jul 17 '05 #3

P: n/a
Phil Powell wrote:
Sorry, both of these failed to produce a result:

get_cfg_var('LimitRequestBody');

ini_get('LimitRequestBody');

From what I see in the manual, ini_get() only gets from php.ini;
get_cfg_var() gets from all config PHP files.

Which in both cases will fail miserably because the value of
LimitRequestBody is only found in /etc/httpd/conf.d/php.conf and can
be altered by the admin which would produce a false result in
get_cfg_var() unless the admin were to bounce the server to repopulate
with the current value.

:(

Phil

"Ben Gribaudo" <bengribaudoN_O_@_S_P_A_Mverizon.net> wrote in message news:<%v*****************@nwrddc03.gnilink.net>...
"Phil Powell" <so*****@erols.com> wrote...
How can you use PHP to determine the size of LimitRequestBody in
advance? I need that for my application as the user will need to know
the absolute limit of what they can upload at one time via PHP.


Hi Phil,

Take a look at:
http://us4.php.net/manual/en/function.get-cfg-var.php
and
http://us4.php.net/manual/en/function.ini-get.php

Have a great day!

Ben :-)
Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16

<?php
$output = `grep /etc/httpd/conf.d/php.conf LimitRequestBody`;
echo $output;
?>
notice, these are backticks... not single quoites.

Michael Austin

Jul 17 '05 #4

P: n/a
Michael Austin <ma*****@firstdbasource.com> wrote in message news:<Y5*****************@newssvr24.news.prodigy.c om>...
Phil Powell wrote:
Sorry, both of these failed to produce a result:

get_cfg_var('LimitRequestBody');

ini_get('LimitRequestBody');

From what I see in the manual, ini_get() only gets from php.ini;
get_cfg_var() gets from all config PHP files.

Which in both cases will fail miserably because the value of
LimitRequestBody is only found in /etc/httpd/conf.d/php.conf and can
be altered by the admin which would produce a false result in
get_cfg_var() unless the admin were to bounce the server to repopulate
with the current value.

:(

Phil

"Ben Gribaudo" <bengribaudoN_O_@_S_P_A_Mverizon.net> wrote in message news:<%v*****************@nwrddc03.gnilink.net>...
"Phil Powell" <so*****@erols.com> wrote...

How can you use PHP to determine the size of LimitRequestBody in
advance? I need that for my application as the user will need to know
the absolute limit of what they can upload at one time via PHP.

Hi Phil,

Take a look at:
http://us4.php.net/manual/en/function.get-cfg-var.php
and
http://us4.php.net/manual/en/function.ini-get.php

Have a great day!

Ben :-)
Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16

<?php
$output = `grep /etc/httpd/conf.d/php.conf LimitRequestBody`;
echo $output;
?>
notice, these are backticks... not single quoites.

Michael Austin


Yep thanx I figured out how to extract the value after all doing
something similar to that. However, I run into the impasse whereby if
php.conf is not readable by Apache and/or the Apache group.. or if
you're not even using Apache at all!

Phil
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.