All is build in Raspberry Pi 3b
this is a bash for Raspberry Pi to get a gpio python php mysql and open i2c-0
pi.sh
#sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak;
#sudo echo "deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ jessie main non-free contrib">>/etc/apt/sources.list.d/raspi.list;
#sudo echo "deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ jessie main non-free contrib">>/etc/apt/sources.list.d/raspi.list;
sudo apt-get update;
sudo apt-get upgrade -y;
sudo apt-get install vim apache2 zsh htop php5 -y;
sudo apt-get install tightvncserver -y;
sudo apt-get install xrdp -y;
#sudo service ufw restart;
sudo service xrdp restart;
sudo apt-get install mysql-server mysql-client -y;
sudo apt-get -y install php5-mcrypt php5-curl php5-cli php5-mysql php5-gd php5-intl php5-xsl;
sudo apt-get install python-smbus -y;
sudo apt-get install libi2c-dev -y;
sudo apt-get install i2c-tools -y;
sudo apt-get install libmysqlclient-dev python-dev -y;
sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple MySQL-python Adafruit-GPIO;
sudo echo "device_tree=bcm2710-rpi-3-b.dtb">>/boot/config.txt;
sudo echo "dtparam=i2c_arm=on">>/boot/config.txt;
sudo echo "dtparam=i2c1=on">>/boot/config.txt;
sudo echo "dtparam=i2c0=on">>/boot/config.txt;
sudo echo "dtparam=i2c_vc=on">>/boot/config.txt;
sudo echo "dtparam=spi=on">>/boot/config.txt;
#i2c-0;
sudo rm /var/www/html/index.html;
sudo cp -r ./html /var/www;
sudo cp -r ./over ~/;
git clone the source code and make it in right path
git clone https://github.com/chnxyzz/Raspberry-Pi-for-Flow-meter.git
cd Raspberry-Pi-for-Flow-meter
sudo su
chmod +x pi.sh
./pi.sh
we should create a database and source the tables;
cd /var/www/html
mysql -u root -p
create database qiti;
source /var/www/html/qiti.sql;
exit
Do reboot
Than you can see it in http://ip/;
Over!!!