473,809 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you find the value of LimitRequestBod y using PHP?

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 LimitRequestBod y 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
4 11871
"Phil Powell" <so*****@erols. com> wrote...
How can you use PHP to determine the size of LimitRequestBod y 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
Sorry, both of these failed to produce a result:

get_cfg_var('Li mitRequestBody' );

ini_get('LimitR equestBody');

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
LimitRequestBod y 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_Mveriz on.net> wrote in message news:<%v******* **********@nwrd dc03.gnilink.ne t>...
"Phil Powell" <so*****@erols. com> wrote...
How can you use PHP to determine the size of LimitRequestBod y 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
Phil Powell wrote:
Sorry, both of these failed to produce a result:

get_cfg_var('Li mitRequestBody' );

ini_get('LimitR equestBody');

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
LimitRequestBod y 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_Mveriz on.net> wrote in message news:<%v******* **********@nwrd dc03.gnilink.ne t>...
"Phil Powell" <so*****@erols. com> wrote...
How can you use PHP to determine the size of LimitRequestBod y 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 LimitRequestBod y`;
echo $output;
?>
notice, these are backticks... not single quoites.

Michael Austin

Jul 17 '05 #4
Michael Austin <ma*****@firstd basource.com> wrote in message news:<Y5******* **********@news svr24.news.prod igy.com>...
Phil Powell wrote:
Sorry, both of these failed to produce a result:

get_cfg_var('Li mitRequestBody' );

ini_get('LimitR equestBody');

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
LimitRequestBod y 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_Mveriz on.net> wrote in message news:<%v******* **********@nwrd dc03.gnilink.ne t>...
"Phil Powell" <so*****@erols. com> wrote...

How can you use PHP to determine the size of LimitRequestBod y 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 LimitRequestBod y`;
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

108
6477
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would describe if applied to a sequence of length items. It returns a tuple of three integers; respectively these are the /start/ and /stop/ indices and the /step/ or stride length of the slice. Missing or out-of-bounds indices are handled in a manner...
6
2477
by: Jon Jagger | last post by:
I was thinking about how you can only use sizeof to find the size of an unmanaged type. I started to wonder if there was a way to find the size of a managed object and came up with the following. It's not guaranteed behaviour but it seems to work. Doesn't lose verifiability either. Enjoy. Cheers Jon Jagger namespace JSL
5
3022
by: Mike Labosh | last post by:
In VB 6, the Form_QueryUnload event had an UnloadMode parameter that let me find out *why* a form is unloading, and then conditionally cancel the event. In VB.NET, the Closing event passes a CancelEventArgs that lets me cancel the Close() operation, but is there still any way to find out *why* a form is closing? This app as a form that needs to be loaded at startup, closed only at shutdown, and then Show() / Hide() for the user. If...
4
2621
by: Aaron Smith | last post by:
Dim dv As DataView = New DataView(FacilitiesDS1.Facilities, "", "ID ASC", DataViewRowState.CurrentRows) Dim iPos As Integer = dv.Find(dr.Item("ID")) Me.BindingContext(FacilitiesDS1, "Facilities").Position = iPos That is the code.. dr is DataRow. If dr.Item("ID") = 3, the find will return position 0, which it should have been 1, and if the ID = 2, it will return 1, which should have been 0.. The DA has a connection string that sorts it...
18
7244
by: ma740988 | last post by:
Trying to get more acclimated with the use of function objects. As part of my test, consider: # include <vector> # include <iostream> # include <algorithm> #include <stdexcept> #include <bitset> using std::vector;
1
2455
by: BobM | last post by:
i read the thread entitled "Convert Field Value String to Actual Field in Expression" It appeared that the final solutions got moore complex not less complex MY PROBLEM IS: 1. get a value from one table as a string "C" 2. lookup the value of a field in a TABLE2 "CD" where the field name = the value of field in TABLE1 I CAN GET THIS USING DLOOkUP, BUT NOT BY FIND METHOD
11
3708
by: Ko van der Sloot | last post by:
Hello I was wondering which behaviour might be expected (or is required) for the following small program. I would expect that find( "a", string::npos ) would return string::npos but is seems to be dependant on which string is searched for. On my system, using gcc 4.1.2, I get: pos1=2 problem because pos1=0
5
5277
gekko3558
by: gekko3558 | last post by:
I am writing a simple binary search tree (nodes are int nodes) with a BSTNode class and a BST class. I have followed the instructions from my C++ book, and now I am trying to get a remove method working. But before I get to the remove, I need to get my find method working. Basically, I am trying to get a "find" method working that will search for a giving int value, and return the node with that value. I have designed my current find with the...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9602
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.