php.ini for LAMP

I currently have a few virtual hosts running on a linode, each having their own wordpress installation. However depending which virtual host, I want to be able to limit my max uploading size. I've tried copying the php.ini from the /etc/php5/apache2/php.ini to each of the individual virtual host root directory, but its not working… any suggestions?

I'm a complete noob and learning… thanks!

2 Replies

Hi itsjohn,

You could try a few methods, the first would be to try using the php ini_set function from within the php files directly, the code would be something like (this equates to 1mb in bytes):

ini_set('upload_max_filesize', '1048567');

Although the above ini_set function is generally not considered to be the best method.

You could also try a .htaccess file or the declaration within the settings in the vhost configuration within httpd.conf

php_value upload_max_filesize "1048567"

I am no expert, but this may help you. Hopefully some php gurus can clear this up if I am way off track.

Asciant

@asciant:

Hi itsjohn,

You could try a few methods, the first would be to try using the php ini_set function from within the php files directly, the code would be something like (this equates to 1mb in bytes):

ini_set('upload_max_filesize', '1048567');

Although the above ini_set function is generally not considered to be the best method.

You could also try a .htaccess file or the declaration within the settings in the vhost configuration within httpd.conf

php_value upload_max_filesize "1048567"

I am no expert, but this may help you. Hopefully some php gurus can clear this up if I am way off track.

Asciant

Hey, Thanks!

I tried this in the vhost configuration. I hope this is correct. Is there a more efficient way of doing this?

 <ifmodule mod_php5.c="">php_value post_max_size "32M"
       php_value upload_max_filesize "32M"</ifmodule> 

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct