I'm using Google Compute Engine with a lamp instance.
I located my php.ini file here /etc/php5/apache2/php.ini
and I edited with sudo nano php.ini.
Whatever variable I gave except the default one which is 2M to upload_max_filesize it give me a 500 server error when I try to upload an image.
Of course I restarted my server after my modifications.
Thanks for your time.