Executing audio in php

0

How can I load an audio tag with the file off my server

<audio controls>
  <source src="../../spool/teste.mp3" type="audio/mp3">
</audio>

At the same level of my www folder I have a folder called musics, where you have the songs that I want to play. I can use a file_exists to know if I have access and I can also unlink, but I can not load the src. how can I do this? also it is not possible if I pass the exact path C: /wamp/Musica/test.mp3

    
asked by anonymous 03.08.2017 / 14:04

1 answer

0

You can not access files outside the www directory of the Web server. This is also for security reasons.

Or you must copy the files you want to share into this directory or, in the Web server settings, change the root directory. With XAMPP, for example, in the file httpd.conf the configuration is in line:

DocumentRoot "C:/xampp/htdocs"
    
03.08.2017 / 14:23