With all the support this is how you install pass2php.
if im archived the way correct haha.
This is what I did now:
Code: Select all
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache
sudo apt-get install mysql-server
sudo apt-get install phpmyadmin
sudo mysql_secure_installation
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'domotica'@'localhost' IDENTIFIED BY 'domotica';
CREATE DATABASE domotica;
Download the GitHub package zip file. In this zip file you have ‘Create-Update SQL Database.txt'
Code: Select all
mysql -u domotica -p domotica < 'Create-Update SQL Database.txt'
mysql -u root -p
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| domotica |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
sudo ln -s /usr/share/phpmyadmin /var/www/html
Copy all files from the ZIP to:
So lots of files are in /var/www/html/
And lots of files are in /var/www/html/secure
move config.php to /var/www/
Edit _fetchdomoticz.php and add 2 lines:
Code: Select all
require '/var/www/config.php';
require 'functions.php';
copy from /var/www/html/secure/lua the file
to
Edit _fetchdomoticz.php and add follow line direct below: store($name, $status, $idx, false);
Code: Select all
echo $idx.' '.$name.' = '.$status.'<br>';
so it looks like
Code: Select all
store($name, $status, $idx, false);
echo $idx.' '.$name.' = '.$status.'<br>';
to fetch all devices in dB:
If everything is correct what I post now, then all devices will be now in database.
open
Login and in database: domotica > devices you can see all the devices