0

I am trying to create a system where USB on raspberry pi will be auto mounted and the files can be accessed via an apache server running over local hotspot from the same Raspberry Pi through a script written in PHP.

I am successful in all the steps and file names are visible via local hot spot except that when the files are accessed, it is showing a 404 error.

the index.php is located on /var/www/html/index.php the files are located on /media/usb0

I have tried changing the file permission to 777 (Just to check) but nothing worked for me.

Is there a solution?

  • I have found it necessary to change the permissions on each file. – Wendall Dec 27 '19 at 22:36
  • Isn't it accomplished by sudo chmod -R /foldername? I tried the same but no luck. – pramodcera Dec 27 '19 at 23:04
0

I found the solution myself.

The trick is: linking the the two folders by a symbolic link Opening terminal from within the "files" folder (/var/www/html/files on the Pi), and type:

sudo ln -s /media/usb1

(I was running pmount to automount and allocate name usb1 to any usb attached to Pi.

| improve this answer | |
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year. – Ingo Jan 28 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.