NYCPHP Meetup

NYPHP.org

[nycphp-talk] Best way to handle LimitRequestBody $_REQUESTlimitation

rich rich at f1central.net
Mon Jun 21 19:07:04 EDT 2004


[chop]
> Nice function, however, HUGE dilemma: the application that will use this
> function is designed to be fully portable, that is, it can run in Apache
> or IIS or anything that can run PHP.  That means everything in this
> application needs to run equally in any webserver that can handle PHP,
> including this function.
>
> This function works only if you're using Apache since it retrieves a
> specific file /etc/httpd/conf.d/php.conf that has a value I need that
> PHP itself cannot provide to determine the absolute limit of a request.
>
> So how do I write this for IIS or any other PHP-friendly webserver?

Do IIS and other non-apache servers impose the same limitation?

As the web server will normally be the layer above php you will have to
resort to such hackery using whatever configuration files (IIS uses the
metabase which IIRC is similar to the windows registry) are needed before
presenting any upload interface... basically it seems you're gonna be
writing custom code per web server variant... :(

rich


>From hans not junk at nyphp.com  Mon Jun 21 19:12:28 2004
Return-Path: <hans not junk at nyphp.com>
Received: from smtp11.intermedia.net (smtp11.intermedia.net [64.78.21.10])
	by virtu.nyphp.org (Postfix) with ESMTP id D1C94A862F
	for <talk at lists.nyphp.org>; Mon, 21 Jun 2004 19:12:27 -0400 (EDT)
Received: from ehost011-1.intermedia.net ([64.78.21.3]) by
	smtp11.intermedia.net with Microsoft SMTPSVC(6.0.3790.0); 
	Mon, 21 Jun 2004 16:04:36 -0700
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] Best way to handle LimitRequestBody
	$_REQUESTlimitation
Date: Mon, 21 Jun 2004 16:12:26 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F8702AEA2C2 at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] Best way to handle LimitRequestBody
	$_REQUESTlimitation
Thread-Index: AcRX4XktqcixrTj2SxmLCXHVANvwhQAAz+cQ
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-OriginalArrivalTime: 21 Jun 2004 23:04:36.0234 (UTC)
	FILETIME=[1F4A4EA0:01C457E4]
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Mon, 21 Jun 2004 23:12:28 -0000


> Nice function, however, HUGE dilemma: the application that will use
this=20
> function is designed to be fully portable, that is, it can run in
Apache=20
> or IIS or anything that can run PHP.  That means everything in this=20
> application needs to run equally in any webserver that can handle PHP,

> including this function.

Another huge problem is security.  The user that Apache/PHP doesn't
always have read access to the conf files... I know on all of my
platforms they don't.  This is not a solution, it's a hack.

> This function works only if you're using Apache since it retrieves a=20
> specific file /etc/httpd/conf.d/php.conf that has a value I need that=20
> PHP itself cannot provide to determine the absolute limit of=20
> a request.
>=20
> So how do I write this for IIS or any other PHP-friendly webserver?

And sure, it's totally not portable.

There's no solution here that I can see.  As part of installing/setup
directions for the application, you just need to mention these issues.
It's not possible to always make an application totally portable, and in
fact it rarely is.  Your application has some level of dependency that
your end-user has to be aware of.

H




More information about the talk mailing list