Archive for February, 2009

How to change the upload limit for an HTML form in PHP?

Friday, February 27th, 2009

I created an upload function for one of my scripts, and had a problem with the maximum size.So the steps to fix this situation are:

Change the .htaccess for the directory containing the upload script, adding the lines:

# Change upload setting to allow larger uploads
php_value upload_max_filesize 41M
php_value post_max_size 42M
php_value max_execution_time 400
php_value max_input_time 400

Important: the php_value post_max_size must be greater than php_value upload_max_filesize, since any upload will be part of the post variables.

In case you get an “Error 500: Internal server error” after placing the above lines in the .htaccess, it probably means that you server’s configuration is too restrictive.

Open your httpd.conf (or apache2.conf), look for a section such as

    AllowOverride Indexes AuthConfig Limit FileInfo
    Deny from all

and add “Options” to the allow override directive, as:

  AllowOverride Indexes AuthConfig Limit FileInfo Options

Also, if you don’t have it, add:

    Deny from all

to the same section. This will prevent the possibility of any file beginning with .ht* to be served o the browser, even if you forget to change it’s permissions.

Setting a default charcode for an Apache2 webserver

Monday, February 2nd, 2009

If you have problems in your Apache (or Apache2) server not showing ISO characters in your webpages, even if the charset is set in the pages, it’s probably a missing line in your httpd.conf file.

In Apache2 servers, the file is at /etc/apache2/apache2.conf

Open it and look for

#AddDefaultCharset ISO-8859-1"

and remove the # character. (this means uncommenting the line, for the newbies 🙂

Restart the server by typing:

sudo /etc/init.d/apache2 restart

And your webpages shoud now look good.

Setting up a webserver with a ISP Control Panel

Sunday, February 1st, 2009

Setting up a webserver
I use to set my servers following the instructions from howtoforge, but there are a few missing settings due to my language:

how to mount ext2 / ext3 filesystems under Windows?

Sunday, February 1st, 2009

I needed to mount an ext3 filesystem in my windows, in order to share some files (my development scripts and databases) from my Windows setup and my Debian install.

Falko Timme has presented us another great tutorial about this: