upload_max_filesize and post_max_size needs to be greater than 1mb as well. I am sure it is, but might as well get the obvious out of the way.
What's the error that you get?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I am having difficulty uploading images on my server but it does work correctly on my local WAMP server.
Here is my controller code:
use Intervention\Image\ImageManagerStatic as Image;
.
.
$image = $request->file('imageUpload');
$filename = ($image->getClientOriginalName());
$path = public_path('images/' . $filename);
Image::make($image->getRealPath())->save($path);
my $filename is working correctly. If i upload the image manually, the image appears. The images folder has permission 777
I dd(php.info()) and the file_uploads is ON and my image size is 1 MB and upload size limit is 2MB.
Do let me know what I am not doing correctly. Thank you for taking the time to help
-- EDIT: I var_dump the $path and here is what I get: string(65) "/var/www/vhosts/domain.com/domain/public/images/imagename.jpg"
I finally solved it! The "public" folder on my server is not named "public" but httpdocs.
So I used the following code to get my path:
$path = base_path().'/../httpdocs/images/';
@MaverickChan Any ideas as to why the folder imageName.jpg was created?
Please or to participate in this conversation.