Using custom PHP.INI for one site. Windows 2003, 64bit, IIS7.5, PHP 5.3.6

I have one PHP script on one site that requires me to set the maximum download size. I would rather not do it globally.

According to the PHP docs, I cannot set values ​​for some variable, for example post_max_size, max_file_uploadsor upload_max_filesizeusing ini_set. I have seen a number of solutions running PHP in a UNIX box or on Windows with Apache, but none of them are clear to me using IIS.

I understand that I have a way to create my own php.ini file to override a specific php.ini value.

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

[PHP]
post_max_size = 200M
max_file_uploads = 5
upload_max_filesize = 200M

How can I do this without setting values ​​globally on my server?

+3
source share
1 answer

You can set a separate ini file for each website using the PHPRC environment variable as indicated here http://php.net/manual/en/configuration.file.php .

And here's an article on how to install it for IIS 6 and 7.

http://learn.iis.net/page.aspx/745/enable-per-site-php-configuration-on-iis-60-and-iis-7-and-above/

Hope this helps

0
source

All Articles