modihost
01-05-2003, 08:40 AM
for a few months now i have been trying to figure out how to get big file transers working with http_upload and PHP.
The main problem is that by editing my php.ini file the changes are server-wide and i dont want that, because i only want the changes for one virtual host in apache for a special app that we are developing for a client.
So i had to find a way to make changes to the php.ini via the httpd.conf in the virtual host.
<virtualhost www.foobar.com>
ScriptAlias /cgi-bin/ /www/foobar/cgi-bin/
ScriptAlias /cgi-foobar/ /www/foobar/cgi-bin/
User foobar
Group foobargrp
ServerAdmin webmaster@foobar.com
ServerName www.foobar.com
ErrorDocument 404 /missing.html
DocumentRoot /www/foobar
TransferLog logs/foobar
</virtualhost>
If you have PHP4 installed and running as a module mod_php4 simply add this into the virtual server
# For HUGE file uploads - Blake Gardner
<IfModule mod_php4.c>
php_admin_value max_execution_time 0
php_admin_value max_input_time 0
php_admin_value memory_limit 8M
php_admin_value post_max_size 20M
php_admin_flag file_uploads On
php_admin_value upload_max_filesize 20M
</IfModule>
# End
it should all look like this
<virtualhost www.foobar.com>
ScriptAlias /cgi-bin/ /www/foobar/cgi-bin/
ScriptAlias /cgi-foobar/ /www/foobar/cgi-bin/
User foobar
Group foobargrp
ServerAdmin webmaster@foobar.com
ServerName www.foobar.com
ErrorDocument 404 /missing.html
DocumentRoot /www/foobar
TransferLog logs/foobar
<IfModule mod_php4.c>
php_admin_value max_execution_time 0
php_admin_value max_input_time 0
php_admin_value memory_limit 8M
php_admin_value post_max_size 20M
php_admin_flag file_uploads On
php_admin_value upload_max_filesize 20M
</IfModule>
</virtualhost>
those settings are for 20MB upload limit - i hope this solves someone else's problems!
The main problem is that by editing my php.ini file the changes are server-wide and i dont want that, because i only want the changes for one virtual host in apache for a special app that we are developing for a client.
So i had to find a way to make changes to the php.ini via the httpd.conf in the virtual host.
<virtualhost www.foobar.com>
ScriptAlias /cgi-bin/ /www/foobar/cgi-bin/
ScriptAlias /cgi-foobar/ /www/foobar/cgi-bin/
User foobar
Group foobargrp
ServerAdmin webmaster@foobar.com
ServerName www.foobar.com
ErrorDocument 404 /missing.html
DocumentRoot /www/foobar
TransferLog logs/foobar
</virtualhost>
If you have PHP4 installed and running as a module mod_php4 simply add this into the virtual server
# For HUGE file uploads - Blake Gardner
<IfModule mod_php4.c>
php_admin_value max_execution_time 0
php_admin_value max_input_time 0
php_admin_value memory_limit 8M
php_admin_value post_max_size 20M
php_admin_flag file_uploads On
php_admin_value upload_max_filesize 20M
</IfModule>
# End
it should all look like this
<virtualhost www.foobar.com>
ScriptAlias /cgi-bin/ /www/foobar/cgi-bin/
ScriptAlias /cgi-foobar/ /www/foobar/cgi-bin/
User foobar
Group foobargrp
ServerAdmin webmaster@foobar.com
ServerName www.foobar.com
ErrorDocument 404 /missing.html
DocumentRoot /www/foobar
TransferLog logs/foobar
<IfModule mod_php4.c>
php_admin_value max_execution_time 0
php_admin_value max_input_time 0
php_admin_value memory_limit 8M
php_admin_value post_max_size 20M
php_admin_flag file_uploads On
php_admin_value upload_max_filesize 20M
</IfModule>
</virtualhost>
those settings are for 20MB upload limit - i hope this solves someone else's problems!
