Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gr33n_al's avatar

Cant upload images from mobile device | Laravel Nginx Server DO

I have hosted my laravel 10 app in a digital ocean droplet, i installed lemp stack on it and everything works fine except uploading images from any mobile device. It always returns "Image failed to upload", i have increased in php.ini post_max_size=40M upload_max_filesize=40M max_file_uploads=20

and nginx website conf server { ... client_max_body_size 150M; ... }

but still it returns same error. It works fine locally, i can upload image from mobile devices but online nope, it does not work. Any idea why this happens ? i am new to nginx and may be missing something...

0 likes
5 replies
Snapey's avatar

in the file input make sure you set acceptable image types as jpeg or png otherwise Apple devices might send HEIC format which your controller might not handle. If the file is limited to those mentioned, IOS will convert the image before sending.

gr33n_al's avatar

@Snapey I have done it, still does not work, same behaviour, keeps returning "Image failed to upload". It works locally on localhost when i try to upload from mobile with ios and android devices, but only when it is online does not work, thats why i think it has something to do with the nginx server probably.

Snapey's avatar
Snapey
Best Answer
Level 122

@gr33n_al create a file in your public folder

info.php

<?php
phpinfo();

then visit the info.php route and check that your settings are in place

1 like
gr33n_al's avatar

@Snapey Thanks man, seems like my mistake was that i had configured cli php.ini not fpm php.ini, fixed it and its all set now

Please or to participate in this conversation.