954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

.htaccess files

is it possible to change the max file upload and the memory limit allowed for file uploads in php with a .htaccess file.

the server my website is held on will not give me access to the php.ini file and is running php 4.4.9

kevin wood
Posting Whiz
347 posts since Feb 2008
Reputation Points: 27
Solved Threads: 1
 

No, you cannot.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

you can. if you use the following code this will work if your server will allow you to use .htaccess files.

php_value post_max_size 128M
php_value upload_max_filesize 128M
php_value memory_limit 300M


i went about it a slightly easier way tho by putting the following code inside the php script before the image is processed

ini_set('memory_limit', 'xxM')
kevin wood
Posting Whiz
347 posts since Feb 2008
Reputation Points: 27
Solved Threads: 1
 

yes its possible using above code

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You