PHP

Increasing File Upload Limit Using .htaccess

As PHP limits maximal file upload into 2 (two) megabytes, sometimes we need to increase the value to upload bigger files.

Editing php.ini is the easiest way, but it is impossible when our scripts are in a shared hosting. The only few choice is by using .htaccess file. It will rewrite php.ini’s configuration.

I’ve tried this method and worked as I expected: Here’s the .htaccess content:

RewriteEngine On
php_value upload_max_filesize 30M

Last words, there’s manything we can do using .htaccess to overide server’s default configuration ^_*

 

6 Comments

  1. Good tricks :D, udah aku praktekin.. tp lum tau cara buktiin nya 😀

    Nanya Jeng. kalo kita mau file php nya di namakan *.pas tapi tetep bisa di execute as php gimana?
    aku lihat di salah satu web, dia pake extension .pas di semua file php nya.

  2. Duh, so last year bgt sih tutorialnya. Hehheheee…

    @starboard,
    tambahin ini jeng,
    AddType application/x-httpd-php .pas .linoxs

    Soal saya baru ngalamin hari ini he.he.he

  3. selama ga ada kata “admin” nya, setting php.ini bisa di override ( + php jalan sbg module apache 😛 ).

    @kiyat a.k.a starboard
    di .htaccess ? bisa aja jeng.

    http://id2.php.net/configuration.changes

  4. di kasih dimana jeng linoxs?
    di bawah sendiri bisa?

    Jeng Yeni, commentnya buawat diskusi 😀

  5. gua..kalo cuma buat sendiri mah mending pake http://ftp..kenapa? gila aja ngupload file yang gedenya ampe belasan MB liwat script PHP..bisa2timeout server gue :p

  6. Jeng, punya script php yang buat upload zip trus dia bisa de-compress otomatis gak?

    aku biasanya upload pake web2ftp.com cuman skg dia deactive 🙁

    padahal enak klo upload file pake itu, tinggal di zip dah decompress otomatis. 🙂

Leave a Reply