2

This is my first ever post and i'm new to coding so be easy on me. I've started making a website using xampp/Apache. The purpose of this site is to allow me and my family members to watch videos i have on my computer.

So i have all my videos on a external hard drive. That is where i have also installed xampp just to make it easier. The file path for xampp is D:\xampp. The file path for my html and php code is D:\xampp\htdocs\dashboard\movieTime. I've been trying to play a video from my movies file D:\Movies but it won't work.

Here's the code:

<video width="400" controls="controls">
 <source src="../../../../Movies/holden.mp4" type="video/mp4">
</video>

As you can see in the code i go from the html/php code directory back to D:\ then into the Movies folder and it should open up holden.mp4 but it can't access it. I have tested to see that the code can open and play the video when the video is with the base directory. I also checked that the video can be played for each directory up to D:\ . The video can play when in the D:\ directory but the moment i try to go into the Movies folder it won't play.

I have added Alias and directory in the httpd.conf file (This is probably where i messed up but i tried many things before this and different variations).

The Alias

Directory

I also checked the error logs and this is what it says.

Error Logs

Not sure what the errors mean. But could it mean I have to add D:\ directory somewhere?

But basically i can't access my video from my Movies folder which is in a different directory. Any help would be nice! thanks.

  • It looks like the source for the movies (`D:\Movies`) is above the `docroot` for the site (where XAMPP is installed, and looking for directories/files to serve to the browser). You can try symlinking the `D:\Movies` folder to another directory "below" the docroot (i.e., accessible to the server), *or* you can copy/move the files themselves to be somewhere under `D:\xampp\htdocs`. *edit - also, +1 for having your first question be a very thorough and well written one!* – slothluvchunk May 30 '18 at 23:37
  • You may also want to check your conf - here's a similar question that had a good example conf for changing the site's docroot: https://stackoverflow.com/questions/10157333/xampp-change-document-root – slothluvchunk May 31 '18 at 00:06
  • @slothluvchunk yes that would work but i would like to keep xampp and the movies separate. No real reason just prefer it that way. If i still can't find a fix i will probably do that. – TryingToLearn May 31 '18 at 00:37

1 Answers1

0

edit

<source src="../../../../Movies/holden.mp4" type="video/mp4">

to

<source src="file:///D:/Movies/holden.mp4" type="video/mp4">