Unable to locate package php5-fpm? & Break The Limit of Upload Size

Just documented the problem when I failed to install PHP5-FPM to Debian Squeeze.

failed to install php

failed to install php

The problem caused by repository. Here the instruction how to fix it.

First add this to /etc/apt/sources.list

Second fetch and install the GnuPG key

Don’t forget to run apt-get update and apt-get upgrade.

Now, you should be able to install php5-fpm

Perhaps you want minimum install

To run, restart, and stop php, you should do this

service php5-fpm restart | stop | start

Break The Limit

The default php allowed you to upload file no more than 2MB, if you want more you should edit the upload_max_filesize and post_max_size, both code is written on php.ini.

If you don’t know where php.ini located, you can find it with this solution

my case, the result were

It’s no problem if you edit all of these, but you have more effort. As I installed PHP5-fpm I just edit ./etc/php5/fpm/php.ini.

Do not randomly change the number, there are the rules to edit upload_max_filesize and post_max_size. Read the rules here.

In my case I edited the upload_max_filesize to 64M and post_max_size to 96MB.

Restart the php and see the phpinfo() to make sure your configuration.

413 Request Entity Too Large

Other issue when you failed to upload is webserver itself. I use to use nginx as webserver. To solve that just edit /etc/nginx/nginx.conf and add client_max_body_size 96M;

on http section,

You can change 96 to whatever you want. The 96M represent client body size that size 96MB.

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.