skip to Main Content

I’m accessing an image with this :

http://MyServerIP/storage/motorcycle/Image.jpg

if the image is already inside the project directory before XAMPP installed, it works!

C:xampphtdocsm2mobileapp-backendstorageapppublicmotorcycle

But when the image is uploaded from my Flutter app via Laravel to save it locally to my server after installing XAMPP, the uploaded image can not be accessed it’s always ended with 404 | Not Found Laravel page.
I’ve make sure that the image directory, image name & extension, and the URL is all correct.
and that newly uploaded image is really exist on my server folder :

C:xampphtdocsm2mobileapp-backendstorageapppublicmotorcycle

that newly uploaded image can be accessed if i’m reinstalling XAMPP.
But it’s different when i’m using my local IP PC address the newly uploaded file can be accessed right away after i uploaded it.

do u guys know why? i’m sorry i’m still new my words might be wrong but i hope u guys understand my English.
Thankyou!

2

Answers


  1. Chosen as BEST ANSWER

    I've found the solution, i'm uninstalling XAMPP and switching to Laragon.

    If u're facing issues with Laragon about "QueryException, could not find driver"

    U can follow these steps below :

    1. Make sure u're editing the right php.ini, because sometimes laragon is directing you to the wrong php.ini
    2. To locate the find the correct php.ini use "php --ini" on cmd.
    3. After u find and open the correct php.ini uncomment: extension=pdo_mysql

  2. Laravel’s storage:link command creates a symbolic link from the public/storage directory to the storage/app/public directory. This is often used to make files in the storage/app/public directory accessible from the web.

    Here are some steps you can take to troubleshoot and potentially solve the issue:

    Create Symbolic Link:

    Ensure that the symbolic link from public/storage to storage/app/public is created. Run the following command in your Laravel project root directory:

    php artisan storage:link

    This command should create a symbolic link in the public directory named storage, pointing to storage/app/public.

    Check File Permissions:

    Ensure that the storage and public/storage directories have the correct permissions for the web server to read files. You can set the permissions using:

    chmod -R 775 storage

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search