Need ability to set configuration options using single method which will work across multiple server configurations.
- by JMC Creative
I'm trying to set post_max_size and upload_max_filesize in a specific directory for a web application I'm building. I've tried the following in a .htaccess file in the script directory. (upload.php is the script that needs the special configuration)
<Files upload.php>
php_value upload_max_filesize 9998M
php_value post_max_size 9999M
</Files>
That doesn't work at all. I've tried it without the scriptname specificity, where the only thing in the .htaccess file is:
php_value upload_max_filesize 9998M
php_value post_max_size 9999M
This works on my pc-based xampp server, but throws a "500 Misconfiguration Error" on my production server. I've tried also creating a php.ini file in the directory with:
post_max_size = 9999M
upload_max_filesize = 9998M
But this also doesn't always work. And lastly using the following in the php script doesn't work either, supposedly because the settings have already been compiled by the time the parser reaches the line (?):
<?php
ini_set('post_max_size','9999M');
ini_set('upload_max_filesize','9998M');
?>