Skip to content

Commit

Permalink
Windows 10 web server bug fix
Browse files Browse the repository at this point in the history
Windows 10 web server bug fix
  • Loading branch information
taoteh1221 committed Oct 9, 2021
1 parent a01b04c commit c1b5f58
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 19 deletions.
3 changes: 3 additions & 0 deletions ADD-WIN10-SCHEDULER-JOB.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
schtasks /Create /TN XAMPP_CRYPTO_TRACKER /TR "C:/xampp/php/php-win.exe C:/xampp/htdocs/cron.php" /SC MINUTE /MO 20
pause
2 changes: 1 addition & 1 deletion DOCUMENTATION-ETC/CONFIG-EXAMPLE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ $pt_conf['dev']['remote_api_strict_ssl'] = 'off'; // (default = 'off')


// Ignore warning to use PHP-FPM (#PHP-FPM HELPS PREVENT RUNTIME CRASHES# ON LOW POWER DEVICES OR HIGH TRAFFIC INSTALLS)
$pt_conf['dev']['ignore_php_fpm_warning'] = 'no'; // (default = 'no', options are 'yes' / 'no')
$pt_conf['dev']['ignore_php_fpm_warning'] = 'yes'; // (default = 'no', options are 'yes' / 'no')


// Maximum number of BATCHED coingecko marketcap data results to fetch, per API call (during multiple / paginated calls)
Expand Down
8 changes: 6 additions & 2 deletions DOCUMENTATION-ETC/HELP-FAQ.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Just upload this app's files to your PHP-based web server (with an FTP client li

Your web host must have CURL modules activated on your HTTP server. Most web hosting companies provide this "out-of-the-box" already. This app will detect whether or not CURL is setup on your website server (and also alert you to any other missing required system components / configurations).

WINDOWS 10 USERS WHO ARE USING XAMPP WILL NEED TO ENABLE GD FOR PHP (FOR THE ADMIN LOGIN CAPTCHA SECURITY) BEFORE USING THIS APP. PLEASE SEE THE SCREENSHOT LOCATED AT /DOCUMENTATION-ETC/XAMPP-ENABLE-GD.png FOR A VISUAL ON SETTING THIS UP EASILY.

See "Setting Up Price Charts And Email / Text / Telegram / Alexa / Google Home Price Alerts", for how to setup a cron job for additional features.


Expand All @@ -74,7 +76,7 @@ See "Setting Up Price Charts And Email / Text / Telegram / Alexa / Google Home P

You can setup price charts or price alerts in your app install. Price alerts can be sent to email, mobile phone text, Telegram, and Alexa / Google Home notifications. You will be alerted when the [configured default primary currency] price of an asset goes up or down a certain percent or more (whatever percent you choose in the settings), for specific exchange / base pairing combinations for that asset. You can even setup alerts and charts for multiple exchanges / base pairings for the same asset.

Running price charts or price alerts requires setting up a cron job on the Ubuntu / Raspberry Pi machine or website server (this is automated for Ubuntu / Raspberry Pi users who use the automated install script), otherwise charts / alerts will not work. Also see the related settings in Admin Config for charts / alerts.
Running price charts or price alerts requires setting up a cron job or scheduled task on the Ubuntu / Raspberry Pi / Windows 10 machine or website server (this is automated for Ubuntu and Raspberry Pi users using the automated FOLIO-INSTALL.bash script / Windows 10 users who run the ADD-WIN10-SCHEDULER-JOB.bat file), otherwise charts / alerts will not work. Also see the related settings in Admin Config for charts / alerts.

Once a cron job is setup, there is no need to keep your PC / Laptop turned on. The price charts and price alerts run automatically from your app server. If you encounter errors or the charts / alerts don't work during setup, check the error logs file at /cache/logs/error.log for errors in your configuration setup. Basic checks are performed and errors are reported there, and on the Settings page.

Expand All @@ -84,7 +86,9 @@ As mentioned previously, if you run the automated setup / install script for Ubu

Note that you should have the cron job run every 5, 10, 15, 20, or 30 minutes 24/7, based on how often you want chart data points / alerts / any other cron based features to run. Setting up the cron job to run every 20 minutes is the RECOMMENDED lowest time interval. IF SET BELOW 20 MINUTES, lite chart disk writes may be excessive for lower end hardware (Raspberry PI MicroSD cards etc). IF SET #VERY LOW# (5 / 10 minutes), the free exchange APIs may throttle / block your data requests temporarily on occasion for requesting data too frequently (negatively affecting your alerts / charts).

Here is an example cron job command line for reference below (NOT including any cron parameters your host interface may require), to setup as the "command" within a cron job. Replace system paths in the example with the correct ones for your server (TIP - A very common path to PHP on a server is /usr/bin/php):
FOR WINDOWS 10 USERS, just click / run the file 'ADD-WIN10-SCHEDULER-JOB.bat' found in the main directory of the app, and everything will be automatically setup for you. As long as you login into your Windows account after system startup, the scheduled task will run every 20 minutes until your computer is shut off.

FOR LINUX / MAC USERS, here is an example cron job command line for reference below (NOT including any cron parameters your host interface may require), to setup as the "command" within a cron job. Replace system paths in the example with the correct ones for your server (TIP - A very common path to PHP on a server is /usr/bin/php):

/path/to/php -q /home/username/path/to/website/this_app/cron.php

Expand Down
3 changes: 3 additions & 0 deletions DOCUMENTATION-ETC/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ FEATURES / STRUCTURING SECTION
Add ability to email selected news feed links every X days, only including the 'new' posts that are detected.


For admin area pages / sections, consider doing subsections in a modal subwindow, with iframes for loading through 'wizard' steps or opening different categories. It would possibly keep a native app 'feel' while also reducing admin page load times. Think it over, figure out the best solution here for a great UX.


On admin "assets" page, add a button atop the page called " Add New Asset Or Market". Then, on page 1 of the 'add asset' wizard (multi-step on separate modal pages), only have the radio selection choices (only one can be selected): 'Add new asset' and 'Add new market to existing asset'.


Expand Down
Binary file added DOCUMENTATION-ETC/XAMPP-ENABLE-GD.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions DOCUMENTATION-ETC/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4636,6 +4636,23 @@ WILL AUTOMATICALLY PREFORM THE RESET (ALERTS / TRACKING WILL BE ACCURATE AFTERWA



-------------------------------------------------------------------
5.03.2:


-Bug fix for Apache Web Server for Windows 10 support


-Windows 10 batch file, to automatically add cron.php to Windows Task Scheduler


-Misc. UX


-------------------------------------------------------------------






Expand Down
2 changes: 1 addition & 1 deletion FOLIO-INSTALL.bash
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ EOF
elif [ "$opt" = "skip" ]; then

echo " "
echo "Skipping PHP web server setup..."
echo "${cyan}Skipping PHP web server setup...${reset}"

break
fi
Expand Down
7 changes: 5 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Just upload this app's files to your PHP-based web server (with an FTP client li

Your web host must have CURL modules activated on your HTTP server. Most web hosting companies provide this "out-of-the-box" already. This app will detect whether or not CURL is setup on your website server (and also alert you to any other missing required system components / configurations).

WINDOWS 10 USERS WHO ARE USING XAMPP WILL NEED TO ENABLE GD FOR PHP (FOR THE ADMIN LOGIN CAPTCHA SECURITY) BEFORE USING THIS APP. PLEASE SEE THE SCREENSHOT LOCATED AT /DOCUMENTATION-ETC/XAMPP-ENABLE-GD.png FOR A VISUAL ON SETTING THIS UP EASILY.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting up a cron job for charts and price alerts by email / mobile phone text / Alexa / Google Home / Telegram notifications
Expand All @@ -139,7 +140,7 @@ Setting up a cron job for charts and price alerts by email / mobile phone text /

You can setup price charts or price alerts in your app install. Price alerts can be sent to email, mobile phone text, Telegram, and Alexa / Google Home notifications. You will be alerted when the [configured default primary currency] price of an asset goes up or down a certain percent or more (whatever percent you choose in the settings), for specific exchange / base pairing combinations for that asset. You can even setup alerts and charts for multiple exchanges / base pairings for the same asset.

Running price charts or price alerts requires setting up a cron job on the Ubuntu / Raspberry Pi machine or website server (this is automated for Ubuntu / Raspberry Pi users who use the automated install script), otherwise charts / alerts will not work. Also see the related settings in Admin Config for charts / alerts.
Running price charts or price alerts requires setting up a cron job or scheduled task on the Ubuntu / Raspberry Pi / Windows 10 machine or website server (this is automated for Ubuntu and Raspberry Pi users using the automated FOLIO-INSTALL.bash script / Windows 10 users who run the ADD-WIN10-SCHEDULER-JOB.bat file), otherwise charts / alerts will not work. Also see the related settings in Admin Config for charts / alerts.

Once a cron job is setup, there is no need to keep your PC / Laptop turned on. The price charts and price alerts run automatically from your app server. If you encounter errors or the charts / alerts don't work during setup, check the error logs file at /cache/logs/error.log for errors in your configuration setup. Basic checks are performed and errors are reported there, and on the Settings page.

Expand All @@ -149,7 +150,9 @@ As mentioned previously, if you run the automated setup / install script for Ubu

Note that you should have the cron job run every 5, 10, 15, 20, or 30 minutes 24/7, based on how often you want chart data points / alerts / any other cron based features to run. Setting up the cron job to run every 20 minutes is the RECOMMENDED lowest time interval. IF SET BELOW 20 MINUTES, lite chart disk writes may be excessive for lower end hardware (Raspberry PI MicroSD cards etc). IF SET #VERY LOW# (5 / 10 minutes), the free exchange APIs may throttle / block your data requests temporarily on occasion for requesting data too frequently (negatively affecting your alerts / charts).

Here is an example cron job command line for reference below (NOT including any cron parameters your host interface may require), to setup as the "command" within a cron job. Replace system paths in the example with the correct ones for your server (TIP - A very common path to PHP on a server is /usr/bin/php):
FOR WINDOWS 10 USERS, just click / run the file 'ADD-WIN10-SCHEDULER-JOB.bat' found in the main directory of the app, and everything will be automatically setup for you. As long as you login into your Windows account after system startup, the scheduled task will run every 20 minutes until your computer is shut off.

FOR LINUX / MAC USERS, here is an example cron job command line for reference below (NOT including any cron parameters a remote host interface may require), to setup as the "command" within a cron job. Replace system paths in the example with the correct ones for your server (TIP - A very common path to PHP on a server is /usr/bin/php):

/path/to/php -q /home/username/path/to/website/this_app/cron.php

Expand Down
9 changes: 7 additions & 2 deletions app-lib/php/classes/core/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,12 @@ function save_file($file, $data, $mode=false, $lock=true) {

$path_parts = pathinfo($file);

$file_owner_info = posix_getpwuid(fileowner($file));
if ( function_exists('posix_getpwuid') ) {
$file_owner_info = posix_getpwuid(fileowner($file));
}
else {
$file_owner_info = get_current_user();
}


// Does the current runtime user own this file (or will they own it after creating a non-existent file)?
Expand Down Expand Up @@ -2177,4 +2182,4 @@ function ext_data($mode, $request_params, $ttl, $api_server=null, $post_encoding



?>
?>
11 changes: 10 additions & 1 deletion app-lib/php/classes/core/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,15 @@ function chart_data($file, $chart_format, $start_timestamp=0) {
}


foreach ( $data as $check_key => $check_value ) {

if ( $check_value == 'NO_DATA' || $check_value == '' ) {
unset($data[$check_key]);
}

}


return $data;

}
Expand Down Expand Up @@ -3105,4 +3114,4 @@ function system_info() {
}


?>
?>
13 changes: 10 additions & 3 deletions app-lib/php/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


// Application version
$app_version = '5.03.1'; // 2021/October/27TH
$app_version = '5.03.2'; // 2021/October/9TH

// Application edition
$app_edition = 'server'; // 'server' OR 'desktop' edition (LOWERCASE)
Expand Down Expand Up @@ -203,7 +203,8 @@


// Register the base directory of this app (MUST BE SET BEFORE !ANY! init logic calls)
$base_dir = preg_replace("/\/app-lib(.*)/i", "", dirname(__FILE__) );
$file_loc = str_replace('\\', '/', dirname(__FILE__) ); // Windows compatibility (convert backslashes)
$base_dir = preg_replace("/\/app-lib(.*)/i", "", $file_loc );


//!!!!!!!!!! IMPORTANT, ALWAYS LEAVE THIS HERE !!!!!!!!!!!!!!!
Expand Down Expand Up @@ -266,8 +267,14 @@
exit;
}


// Current runtime user
if ( function_exists('posix_getpwuid') && function_exists('posix_geteuid') ) {
$current_runtime_user = posix_getpwuid(posix_geteuid())['name'];
}
else {
$current_runtime_user = get_current_user();
}


// Get WEBSERVER runtime user (from cache if currently running from CLI)
Expand Down Expand Up @@ -499,4 +506,4 @@



?>
?>
4 changes: 2 additions & 2 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@


// Ignore warning to use PHP-FPM (#PHP-FPM HELPS PREVENT RUNTIME CRASHES# ON LOW POWER DEVICES OR HIGH TRAFFIC INSTALLS)
$pt_conf['dev']['ignore_php_fpm_warning'] = 'no'; // (default = 'no', options are 'yes' / 'no')
$pt_conf['dev']['ignore_php_fpm_warning'] = 'yes'; // (default = 'no', options are 'yes' / 'no')


// Maximum number of BATCHED coingecko marketcap data results to fetch, per API call (during multiple / paginated calls)
Expand Down Expand Up @@ -3073,4 +3073,4 @@
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


?>
?>
4 changes: 2 additions & 2 deletions templates/interface/desktop/php/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@
var charts_num = <?=( $sel_opt['show_charts'][0] != '' ? sizeof($sel_opt['show_charts']) : 0 )?>;
var charts_loaded = new Array();

var sorted_by_col = <?=$sel_opt['sorted_by_col']?>;
var sorted_asc_desc = <?=$sel_opt['sorted_asc_desc']?>;
var sorted_by_col = <?=( $sel_opt['sorted_by_col'] ? $sel_opt['sorted_by_col'] : 0 )?>;
var sorted_asc_desc = <?=( $sel_opt['sorted_asc_desc'] ? $sel_opt['sorted_asc_desc'] : 0 )?>;

var charts_background = '<?=$pt_conf['power']['charts_background']?>';
var charts_border = '<?=$pt_conf['power']['charts_border']?>';
Expand Down
8 changes: 6 additions & 2 deletions templates/interface/desktop/php/user/user-sections/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
Your web host must have CURL modules activated on your HTTP server. Most web hosting companies provide this "out-of-the-box" already. This app will detect whether or not CURL is setup on your website server (and also alert you to any other missing required system components / configurations).
<br /><br />

WINDOWS 10 USERS WHO ARE USING XAMPP WILL NEED TO ENABLE GD FOR PHP (FOR THE ADMIN LOGIN CAPTCHA SECURITY) BEFORE USING THIS APP. PLEASE SEE THE SCREENSHOT LOCATED AT <a href='https://raw.githubusercontent.com/taoteh1221/Open_Crypto_Tracker/main/DOCUMENTATION-ETC/XAMPP-ENABLE-GD.png' target='_blank'>/DOCUMENTATION-ETC/XAMPP-ENABLE-GD.png</a> FOR A VISUAL ON SETTING THIS UP EASILY.<br /><br />

See "<span class='bitcoin'>Setting Up Price Charts And Email / Text / Telegram / Alexa / Google Home Price Alerts</span>"</a>, for how to setup a cron job for additional features.

</div>
Expand Down Expand Up @@ -197,7 +199,7 @@
You can setup price charts or price alerts in your app install. Price alerts can be sent to email, mobile phone text, Telegram, and Alexa / Google Home notifications. You will be alerted when the [configured default primary currency] price of an asset goes up or down a certain percent or more (whatever percent you choose in the settings), for specific exchange / base pairing combinations for that asset. You can even setup alerts and charts for multiple exchanges / base pairings for the same asset.
<br /><br />

Running price charts or price alerts requires setting up a cron job on the Ubuntu / Raspberry Pi machine or website server (this is automated for Ubuntu / Raspberry Pi users who use the automated install script), otherwise charts / alerts will not work. Also see the related settings in Admin Config for charts / alerts.
Running price charts or price alerts requires setting up a cron job or scheduled task on the Ubuntu / Raspberry Pi / Windows 10 machine or website server (this is automated for Ubuntu and Raspberry Pi users using the automated FOLIO-INSTALL.bash script / Windows 10 users who run the ADD-WIN10-SCHEDULER-JOB.bat file), otherwise charts / alerts will not work. Also see the related settings in Admin Config for charts / alerts.
<br /><br />

Once a cron job is setup, there is no need to keep your PC / Laptop turned on. The price charts and price alerts run automatically from your app server. If you encounter errors or the charts / alerts don't work during setup, check the error logs file at /cache/logs/error.log for errors in your configuration setup. Basic checks are performed and errors are reported there, and on the Settings page.
Expand All @@ -212,7 +214,9 @@
Note that you should have the cron job run every 5, 10, 15, 20, or 30 minutes 24/7, based on how often you want chart data points / alerts / any other cron based features to run. Setting up the cron job to run every 20 minutes is the RECOMMENDED lowest time interval. IF SET BELOW 20 MINUTES, lite chart disk writes may be excessive for lower end hardware (Raspberry PI MicroSD cards etc). IF SET #VERY LOW# (5 / 10 minutes), the free exchange APIs may throttle / block your data requests temporarily on occasion for requesting data too frequently (negatively affecting your alerts / charts).
<br /><br />

Here is an example cron job command line for reference below (NOT including any cron parameters your host interface may require), to setup as the "command" within a cron job. Replace system paths in the example with the correct ones for your server (TIP - A very common path to PHP on a server is /usr/bin/php):
FOR WINDOWS 10 USERS, just click / run the file 'ADD-WIN10-SCHEDULER-JOB.bat' found in the main directory of the app, and everything will be automatically setup for you. As long as you login into your Windows account after system startup, the scheduled task will run every 20 minutes until your computer is shut off.<br /><br />

FOR LINUX / MAC USERS, here is an example cron job command line for reference below (NOT including any cron parameters your host interface may require), to setup as the "command" within a cron job. Replace system paths in the example with the correct ones for your server (TIP - A very common path to PHP on a server is /usr/bin/php):
<br /><br />

<pre class='rounded' style='display: inline-block;<?=( $pt_gen->is_msie() == false ? ' padding-top: 1em !important;' : '' )?>'><code class='hide-x-scroll less' style='white-space: nowrap; width: auto; display: inline-block;'>/path/to/php -q /home/username/path/to/website/this_app/cron.php</code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ classname: 'balloon-tooltips',

<div> &nbsp; </div>

<p><a style='font-weight: bold;' href='README.txt' target='_blank'>Editing The Portfolio Assets List, and Enabling Email / Text / Telegram / Alexa / Google Home Price Alerts (installation on Ubuntu, Raspberry Pi, or website)</a></p>
<p><a style='font-weight: bold;' href='README.txt' target='_blank'>Editing The Portfolio Assets List, and Enabling Email / Text / Telegram / Alexa / Google Home Price Alerts (installation on Ubuntu, Raspberry Pi, Windows 10, or website)</a></p>



Expand Down

0 comments on commit c1b5f58

Please sign in to comment.