Comments (5)
Hi,
my example of rewrite ^(.*)$ /index.php?uri=$1 last;
is for NGINX. And NGINX does not add url parameters like ?token=0
or ?sSearchtype=3&Search=...
to the variable $1
. These parameters are stored and passed to PHP using other variables.
Thus, I my example $1
would only contain /setupapp/fs/asp/BrowseXML/loginXML.asp
or /setupapp/fs/asp/BrowseXML/Search.asp
.
I am not very experienced with lighttpd, but i assume a simple
url.rewrite-if-not-file = ( "" => "/index.php?uri=${url.path}" )
should do it (https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_rewrite).
${url.query}
should contain the query terms like sSearchtype=3&Search=...
, which need to be send to php separately or if this is not the case, then url.rewrite-if-not-file = ( "" => "/index.php?path=${url.path}&${url.query}" )
might work.
from radio-api.
interesting, trying the second option, I get error 500 :(
xx.xx.xx.xx pri.logon.wifiradiofrontier.com - [16/Feb/2024:18:03:42 +0100] "GET /setupapp/fs/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.0" 500 0 "-" "FS NS/1.0"
xx.xx.xx.xx pri.logon.wifiradiofrontier.com - [16/Feb/2024:18:03:42 +0100] "GET /setupapp/fs/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.0" 500 0 "-" "FS NS/1.0"
Is there a way to find out in PHP what is generating this 500 ?
and then http 303
xx.xx.xx.xx pri.logon.wifiradiofrontier.com - [16/Feb/2024:18:03:42 +0100] "GET /setupapp/fs/asp/BrowseXML/Search.asp?sSearchtype=3&Search=a680a4929eb0d0a25ee9782d39aebe3e&mac=&dlang=eng&fver=7 HTTP/1.0" 303 0 "-" "FS NS/1.0"
xx.xx.xx.xx radio.web.ui - [16/Feb/2024:18:03:42 +0100] "GET /gui/view.php?redirFromIndex HTTP/1.0" 200 2300 "-" "FS NS/1.0"
from radio-api.
Hi,
Lighttpd or PHP fpm should create some PHP error logs. But the location depends on the setup.
You may also check the troubleshooting section of Radio-API.
I just tried to run Radio-API via Lighttpd, for me url rewriting works with this line:
url.rewrite-if-not-file = ( "[^\/](\?.*)$" => "/index.php?uri=${url.path}&${url.query}" )
Just more info about my test, I used a Docker container with Lighttpd besides one with PHP fpm:
version: "2"
services:
server:
image: jitesoft/lighttpd:latest-cgi
restart: "no"
ports:
- "8080:80"
environment:
- PORT=80
- SERVER_NAME=localhost
- SERVER_ROOT=/var/www/html
- CONFIG_FILE=/etc/lighttpd/lighttpd.conf
- SKIP_HEALTHCHECK=true
- CGI_HOST=phpfpm
- CGI_PORT=9000
- CHECK_LOCAL=enable
- CGI_FILE_EXT=.php
volumes:
- ./php/:/var/www/html/ # just mount Radio-API from the Radio-API Source
- ./urlrewrite.conf:/etc/lighttpd/conf.d/urlrewrite.conf
depends_on:
- phpfpm
phpfpm:
image: php:8-fpm-alpine
restart: "no"
volumes:
- ./php/:/var/www/html/
Whereas urlrewrite.conf
only contained one like
url.rewrite-if-not-file = ( "[^\/](\?.*)$" => "/index.php?uri=${url.path}&${url.query}" )
from radio-api.
Thanks for the tips, that is very useful !
I'm not using the docker install version but the manual version on Armv7l, and I've noticed by asking PHP to show errors that it needs the php-mbstring package.
I had several messages like this :
FastCGI-stderr:PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mb_substitute_character() in /media/localbackup/web/Radio-API-2.8.2/php/classes/Output.php:17
installing the missing package
apt install php-mbstring
using the last regex in lighttpd config, I see :
2024-02-17 10:20:38: (response.c.420) -- parsed Request-URI
2024-02-17 10:20:38: (response.c.422) Request-URI : /setupapp/fs/asp/BrowseXML/loginXML.asp?token=0
2024-02-17 10:20:38: (response.c.424) URI-scheme : http
2024-02-17 10:20:38: (response.c.426) URI-authority : pri.logon.wifiradiofrontier.com
2024-02-17 10:20:38: (response.c.428) URI-path (clean): /setupapp/fs/asp/BrowseXML/loginXML.asp
2024-02-17 10:20:38: (response.c.430) URI-query : token=0
2024-02-17 10:20:38: (response.c.420) -- parsed Request-URI
2024-02-17 10:20:38: (response.c.422) Request-URI : /index.php?uri=/setupapp/fs/asp/BrowseXML/loginXML.asp&token=0
2024-02-17 10:20:38: (response.c.424) URI-scheme : http
2024-02-17 10:20:38: (response.c.426) URI-authority : pri.logon.wifiradiofrontier.com
2024-02-17 10:20:38: (response.c.428) URI-path (clean): /index.php
2024-02-17 10:20:38: (response.c.430) URI-query : uri=/setupapp/fs/asp/BrowseXML/loginXML.asp&token=0
2024-02-17 10:20:38: (response.c.509) -- logical -> physical
2024-02-17 10:20:38: (response.c.511) Doc-Root : /srv/Radio-API-2.8.2/php/
2024-02-17 10:20:38: (response.c.513) Basedir : /srv/Radio-API-2.8.2/php/
2024-02-17 10:20:38: (response.c.515) Rel-Path : /index.php
2024-02-17 10:20:38: (response.c.517) Path : /srv/Radio-API-2.8.2/php/index.php
2024-02-17 10:20:38: (response.c.536) -- handling subrequest
2024-02-17 10:20:38: (response.c.538) Path : /srv/Radio-API-2.8.2/php/index.php
2024-02-17 10:20:38: (response.c.540) URI : /index.php
2024-02-17 10:20:38: (response.c.542) Pathinfo :
2024-02-17 10:20:38: (gw_backend.c.2674) handling the request using fastcgi
2024-02-17 10:20:38: (response.c.179) fd:17 resp: HTTP/1.0 200 OK
xxx.xx.xx.xx pri.logon.wifiradiofrontier.com - [17/Feb/2024:10:20:38 +0100] "GET /setupapp/fs/asp/BrowseXML/loginXML.asp?token=0 HTTP/1.0" 200 49 "-" "FS NS/1.0"
which is better 👍
I have "Marshall radios devices" which have no screen on them, but the
And, now, I can see the login code in the Mashall App for my device !
Browsing to the radios, I can see all of them !
MANY THANKS for your hints, this was really helpfull !
from radio-api.
Hi,
I am glad that it works now. I have added mbstring to the setup.md.
from radio-api.
Related Issues (20)
- Unable to start a backup HOT 4
- Any further intention in making the API even more interesting for the "international" audience? HOT 2
- Medion MD88289 shows "Network Error" when being redirected to Radio API HOT 9
- Setup Test Program HOT 1
- Domain GUI and Radio
- Question ("How To" Videos) HOT 5
- Medion Radio - Network Timeout HOT 7
- Question about nextcloud share HOT 8
- Update own Streams via interval HOT 3
- No GUI interface on the web server. My installation settings are wrong? HOT 2
- Sonoro radio not supported? HOT 4
- Uncaught RedisException: Connection refused HOT 2
- Authentication for token-protected stream HOT 4
- Characters with diacritics are stripped HOT 2
- Does this software require redis dependency to function? HOT 26
- "Update Available" still shown after Update
- v2.8.3 with CONF_USE_JSON_CACHE=true errors HOT 4
- Station logo not shown everytime HOT 5
- time.wifiradiofrontier.com HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radio-api.