By ggentile on
I have some drupal sites up and running but I need to change the file size limit (currently set at 8mb) in order to use flash video. I need to put some videos on my site because I cannot run them on youtube or another server for work related reasons.
What I need to place in my php.ini or .htaccess file is this:
o post_max_size=100M
o upload_max_filesize=100M
o max_execution_time=1000
o max_input_time=1000
Where does this go? below I will paste my entire .htaccess, and then the php file. I have no idea what to delete or change. Please be specific with what line. . .
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $
this is the php file:
register_globals = off
allow_url_fopen = off
expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
[Zend]
zend_extension=/usr/local/zo/ZendExtensionManager.so
zend_extension=/usr/local/zo/4_3/ZendOptimizer.so
THANKS!
Comments
You can place them anywhere
You can place them anywhere in the file, as long as there is no similar directive further down the file which changes the value.
You must also set a memory_limit higher that post_max_size, because that takes memory and the rest of Drupal has to work as well. (This is mentioned in http://php.net/ini.core, in the explanation of post_max_size)
Either in php.ini
or, in .htaccess
However, if you intend to do any processing to the uploaded files, for derivatives, resizing etc, the memory requirements may become too high and you will need to do some testing.
but do be careful on 128..
just found out my own host limits to 99m on mem limit and it was causing some odd timeouts on a test site...
........................................................................
i love to waste time: http://twitter.com/passingnotes
Used recipe, but no change noted
thanks for the quick responce. I used your suggestion. I first changed the php.ini file--but when I returned to my website, no change was noted (still says my limit is 8mb). I then changed the .htaccess file and the site crased (it is now back up). Am I missing a step? do I have to run a program or cron?
Sorry that I´m not getting it, the instructions make sense.
New to drupal--filmmaker from New York living in Argentina
Normally nothing else should
Normally nothing else should be needed.
Are you on you own server or on a shared host? Is php.ini the main one or a local copy under Drupal. Try some moderate settings, in case you are hitting some limit of the server which makes your settings to be ignored. For example try 32M, 16M, 15M for the three values and then run a phpinfo() to check.