1

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 a local hotspot 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?

Greenonline
2,9725 gold badges27 silver badges38 bronze badges
asked Dec 27, 2019 at 16:26
2
  • I have found it necessary to change the permissions on each file. Commented Dec 27, 2019 at 22:36
  • Isn't it accomplished by sudo chmod -R /foldername? I tried the same but no luck. Commented Dec 27, 2019 at 23:04

2 Answers 2

1

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 the name usb1 to any USB attached to Pi.

Rohit Gupta
3552 gold badges4 silver badges12 bronze badges
answered Dec 29, 2019 at 14:06
1
  • 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. Commented Jan 28, 2020 at 21:33
-1

Bonjour,

Comment as-tu fais pour l'étape 1 ? je cherche à faire pareil.

Merci par avance pour ta réponse,

Jordane GUYONNET

answered Aug 29, 2023 at 12:00
2
  • You are not supposed to ask questions as an answer. If anything, create your own question. Commented Aug 29, 2023 at 12:37
  • please write the answer in english Commented Aug 30, 2023 at 21:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.