Background:
I am running Motion and GPIO as a garage controller on a Pi running Raspbian currently. It all works as I want with a simple web page and a couple shell and php scripts to do what I want. It'd be really cool if I could replace Raspbian with RuneOS and add my web bage to what is being served. I am very much a noob as far as html/php, etc and especially confused with nginx
Where I am so far: I have loaded GPIO on the Pi running RuneOS and that seems to work. I have added another page at localhost:88 which will almost display my simple page script. I have placed all my files for this web page in /var/www/garage. I have a couple issues, though, to get it all working properly. Any suggestions appreciated.
1) I have a couple text files that need to be parsed to populate a couple fields on the page. The php script will run and change the text in the file, but the web page is not reading it. When I run the php script from the command line, it will also not grab the file contents. The
<input type="submit" value="Light <?echo $light_label;?>" style="height:75px; width:75px"/>
instead of the file contents (which I confirm is changing appropriately), it shows "<?echo $light_label;?> in the php script, it is supposed to parse the file and put the contents in an array and it is like this is not happening.
if ( file_get_contents("/var/www/garage/light_flag") == 1) {
$light_label = "on"; }
else {
$light_label = "off";}
Is there a setting or configuration line I am missing in the nginx.conf?
2) When I tried to install Motion, i got a complaint that libav.xx is already installed and is conflicting... I have updated RuneOS via pacman and may have inadvertently caused a conflict. This is a configuration problem and I was going to 'go back' to a new/clean Rune 0.3 and see if I am able to install gpio and motion, but any gotchas I may encounter?
My nginx.conf addition for my web page:
...
# start GARAGE section [/garage]
server {
listen 88;
root /var/www/garage;
index login.php;
server_name localhost;
location ~* (.+)\.(?:\d+)\.(php|sh)$ {
try_files $uri $1.$2;
}
# php5-fpm
location ~ \.php$ {
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
root /var/www/garage;
fastcgi_pass unix:/var/run/php-display.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_read_timeout 3600;
}
} # end GARAGE section
...
Love RuneOS and looking forward to my 3rd install to get music in the garage!