Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a single PHP script on a single site that requires me to set the upload size maximum fairly high. I would prefer not to do this globally.

According to the PHP docs, I can not set the values for some variable such as post_max_size , max_file_uploads or upload_max_filesize using ini_set. I've seen a number of solutions here running PHP on a UNIX box or on Windows running Apache, but none that are clear to me using IIS.

My understanding is that there is a way for me to have a custom php.ini file to override specific php.ini value.

Ideally, I would love to have a php.ini file in the folder with that one script that looks something like this:

post_max_size = 200M
max_file_uploads = 5
upload_max_filesize = 200M

How can I accomplish this without setting the values globally on my server?


share|improve this question

It's certainly possible to use different PHP settings for a specific website or to even use a different version of PHP per website. An article titled Using FastCGI to Host PHP Applications on IIS 7 by Ruslan Yakushev on explains how to set it up. It also contains other useful tips on how to set it up securely.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.