Skip to content

ericcheng05/SwimActivityTool

Repository files navigation

Swim Activity Tool

Originated by Stéphane Dubois in this Repo

Purpose

Correction of Swim Event Created by Garmin Watches

Procedures

Instructions for Ubuntu 20.04

Update APT

sudo apt update
sudo apt upgrade

Install NGINX, PHP and SQLite3

sudo apt install php php-fpm php-sqlite3 php-zip php-dev sqlite3 nginx 

Clone the Code from Repo, Update Owner

git clone https://github.com/ericcheng05/SwimActivityTool.git swt
cd swt
mkdir www/data
cat sql/swtdb.sql | sqlite3 www/data/swt.sqlite3
sudo chown -R -v  www-data:www-data www/data 
sudo cp -R www /var/www/swt

Copy Nginx Config

sudo cp  example.com.php74.conf /etc/nginx/sites-available
sudo ln -s /etc/nginx/sites-available/example.com.php74.conf /etc/nginx/sites-enabled/

Make file for the Modules

cd ext
phpize
./configure
make
sudo cp modules/swt.so /usr/lib/php/20190902/

Add One Line for php.ini File

sudo vim /etc/php/7.4/fpm/php.ini
extension=swt.so

Restart NGINX and PHP

sudo service nginx restart
sudo service php7.4-fpm restart

Instructions for Ubuntu 22.04

For Ubuntu 22.04

Update APT

sudo apt update
sudo apt upgrade

Install NGINX, PHP and SQLite3

sudo apt install php php-fpm php-sqlite3 php-zip php-dev sqlite3 nginx 

Clone the Code from Repo, Update Owner

git clone https://github.com/ericcheng05/SwimActivityTool.git swt
cd swt
mkdir www/data
cat sql/swtdb.sql | sqlite3 www/data/swt.sqlite3
sudo chown -R -v  www-data:www-data www/data 
sudo cp -R www /var/www/swt

Copy Nginx Config

sudo cp  example.com.php81.conf /etc/nginx/sites-available
sudo ln -s /etc/nginx/sites-available/example.com.php81.conf /etc/nginx/sites-enabled/

Make file for the Modules

cd ext
phpize
./configure

Remove Function Parameter "TSRMLS_C" on Line 115

vim ext/swt_php.cpp

Continue Make file for the Modules

make
sudo cp modules/swt.so /usr/lib/php/20210902/

Add One Line for php.ini File

sudo vim /etc/php/8.1/fpm/php.ini
extension=swt.so

Restart NGINX and PHP

sudo service nginx restart
sudo service php8.1-fpm restart

(Optional) Install Postfix for Mail Contact

Encounter Errors?

Failed to Upload Activity File to the Web Apps

  1. Check Nginx Log in /var/log/nginx/error.log
  2. If there is an PDO Error, it might be Permission Settings of the SQLite File where www-data cannot write the file. Check the Ownership and Change to www-data (Nginx Default)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published