Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

[PHP]
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?

Thanks.

share|improve this question
add comment

1 Answer

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 IIS.net explains how to set it up. It also contains other useful tips on how to set it up securely.

share|improve this answer
add comment

Your Answer

 
discard

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.