Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5948215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:04:34+00:00 2026-05-22T17:04:34+00:00

I have a web app that redirects all requests to the virtual host to

  • 0

I have a web app that redirects all requests to the virtual host to a controller, which then decides which files to include and run based on the URL. There is a web service that accepts large XML files through POST. I need the memory_limit and post_max_ to be ~32M for the app, except for service that accepts the XML, which will need their limits to be closer to 1024M. ini_set('memory_limit','1024M') works within the script, but won’t work for the post_max_size.

I can’t seem to figure out how to do it. I was trying something similar to this:

<VirtualHost *:80>
ServerName test.com
DocumentRoot /var/www/test.com/html


php_admin_value include_path .:/var/www/test.com/includes:/var/www/test.com/includes/libs

php_value session.use_only_cookie 1
<Location />
    php_value memory_limit 32M
    php_value post_max_size 30M
    php_value upload_max_filesize 29M
</Location>
<Location /services/big-service>
    php_value memory_limit 1024M
    php_value post_max_size 128M
</Location>

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/(.*)$
RewriteCond %{REQUEST_URI} !^/(.*)(html|gif|jpg|png|ico|css|js|dtd|swf|flv|xml)$
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^/(.*)$ /Controller.php/$1 [PT]

</VirtualHost>

So, with the above config, if Controller.php looks like

<?php
echo '<pre>';
var_dump(ini_get('memory_limit'));
var_dump(ini_get('post_max_size'));
var_dump(ini_get('upload_max_filesize'));

I’ll receive
string(3) “32M”
string(3) “30M”
string(3) “29M”

if I visit http://test.com, and http://test.com/services/big-service, but I’d like to see the higher limits for the later URLs.

Does anybody have any solutions to this that don’t resort to using and accessing the service script directly through the URL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:04:35+00:00Added an answer on May 22, 2026 at 5:04 pm

    The problem is mod_rewrite is causing it to always go to /Controller.php, so the Location block with the services is never used. Using additional mod_rewrite rules

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/services/(.*)$
    RewriteCond %{REQUEST_URI} !^/(.*)(html|gif|jpg|png|ico|css|js|dtd|swf|flv|xml)$
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^/(.*)$ /ControllerBig.php/services/$1 [PT]
    

    And then having ControllerBig be a clone of Controller

    <?php
    require_once('Controller.php');
    

    will work.

    Edit: Full VirtualHost block:

    <VirtualHost *:80>
    ServerName test.com
    DocumentRoot /var/www/test.com/html
    
    php_admin_value include_path .:/var/www/test.com/includes:/var/www/test.com/includes/libs
    
    php_value session.use_only_cookie 1
    <Location />
        php_value memory_limit 32M
        php_value post_max_size 30M
        php_value upload_max_filesize 29M
    </Location>
    <Location /services/big-service>
        php_value memory_limit 1024M
        php_value post_max_size 128M
    </Location>
    
    RewriteEngine On
    
    RewriteCond %{REQUEST_URI} ^/services/(.*)$
    RewriteCond %{REQUEST_URI} !^/(.*)(html|gif|jpg|png|ico|css|js|dtd|swf|flv|xml)$
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^/(.*)$ /ControllerBig.php/services/$1 [PT]
    
    RewriteCond %{REQUEST_URI} ^/(.*)$
    RewriteCond %{REQUEST_URI} !^/(.*)(html|gif|jpg|png|ico|css|js|dtd|swf|flv|xml)$
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^/(.*)$ /Controller.php/$1 [PT]
    
    </VirtualHost>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have small web app that generate PDF files as a report. I'm trying
I have a web app that is heavily loaded in javascript and css. First
I have a web app that only registered users can use, therefore I should
We have an web app that is talking to Netsuite via Netsuite's web services.
I have a web app that I've recently applied a jQuery ThemeRoller theme to.
I have a web app that lets a client define a daily rate for
We have a web app that we update and release almost daily. We use
I have a web app that uses the Active Directory Membership Provider and when
I have a web app that currently is inserting x (between 1 + 40)
Problem: We have a web app that calls some web services asynchronously (from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.