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

Sourav's avatar

File or Image do not save in cPanel live server but save in local host

I have used this code to save image or file:

$image1 = Input::file('deducted_file' . $i); $destination = 'uploads/';

        if ($image1 != null) {
            $filename1 = Str::lower(
                pathinfo($image1->getClientOriginalName(), PATHINFO_FILENAME)
                . '-'. uniqid(). '.'. $image1->getClientOriginalExtension()
            );
            $image1->move($destination, $filename1);
            $feesadditional->deducted_amount_file = $filename1;
        }

it works in local host but do not work in cPanel live server that is it do not give any error when i choose and save a file or image but it saves nothing in database. In local host I changed php ini file to file enable true. I think I have to enable it in cPanel but I dont know how to change this php.ini file in cPanel.

0 likes
6 replies
Sourav's avatar
Sourav
OP
Best Answer
Level 1

Thank you for your reply , yes in server there are several problems one of them is real path , i changed it and also it is necessary to change the php version in cPanel . And at last i have succeed to save image in server.

Mithlesh_Patel's avatar

@Sourav How did you solve this can you share me i am facing similar issue while saving images on server.

ollie_123's avatar

@Mithlesh_Patel please don't comment on threads that are 8 years old. Please start a new thread and put your question there.

Please or to participate in this conversation.