PHP: Icecast Now Playing Script is Not Working

前端 未结 2 835
有刺的猬
有刺的猬 2021-01-15 19:04

I am attempting to use the Icecast Now Playing PHP script from: https://code.google.com/p/icecast-now-playing-script/

I have uploaded all the files to my web server

2条回答
  •  遥遥无期
    2021-01-15 19:46

    My guess is that your server is not allowing HTTP stream wrappers.

    In the icecast.php script the function getStreamInf() is being called and at the top it attempts to open the stream with:

    $str = @file_get_contents(SERVER.'/status.xsl?mount='.MOUNT);
    

    To debug this, do 2 things. First remove the @ which suppresses error output on the file_get_contents call. Then add temporary debugging output:

    $str = file_get_contents(SERVER.'/status.xsl?mount='.MOUNT);
    var_dump($str);
    

    If you get a security related error, rather than data back, then you need to look at your php.ini file for the server.

    allow_url_fopen = on
    

    Needs to be set for file_get_contents to be able to open a url, as this script attempts to do. You have to be able to change that setting on your server, if it is set to off, and you have to be able to restart your web server for those changes to take effect.

提交回复
热议问题