Ysurac / FlightAirMap

Open source project displaying live aircrafts, ships or trackers on 2D/3D map. Browse through the data based on a particular aircraft, airline, airport, tracker or vessel to search through the database or see extensive statistics. Can use ADS-B in SBS1 format (dump1090, Radarcape,...), VRS, VA (VATSIM, IVAO whazzup.txt, phpvms,...), ACARS (acarsdec, acarsdeco2), APRS, AIS as datasource.
https://www.flightairmap.com/
GNU Affero General Public License v3.0
515 stars 156 forks source link

Mac OS X undefined function gmp_strval() in /Library/WebServer/Documents/flightairmap/require/class.SBS.php:26 #435

Open mikkyo9 opened 5 years ago

mikkyo9 commented 5 years ago

After going through the install on Mac OS X, populating everything, I attempt to run daemon-spotter.php manually and get

Fatal error: Uncaught Error: Call to undefined function gmp_strval() in /Library/WebServer/Documents/flightairmap/require/class.SBS.php:26
Stack trace:
#0 /Library/WebServer/Documents/flightairmap/scripts/daemon-spotter.php(1735): SBS->parse('MSG,4,1,1,A48E9...')
#1 {main}
  thrown in /Library/WebServer/Documents/flightairmap/require/class.SBS.php on line 26

PHP is install via brew

$ php -version
PHP 7.3.6 (cli) (built: Jun 17 2019 08:40:34) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.6, Copyright (c) 1999-2018, by Zend Technologies

gmp support is builtin

$ php -i |grep "gmp "
gmp support => enabled
mikkyo9 commented 5 years ago

This is a bug in the protocol decode. I had my dump1090 feed set to SBS, and I get this error. Digging into it class.SBS.php gets this: $typehex M $hex SG,7,1,1,A57F04,1,2019/07/13,20:18:51.805,2019/07/13,20:18:51.858,,9100,,,,,,,,, Which causes gmp_strval( gmp_init($hex,16), 2) to fail.

Switching the Format to Auto, avoids the bug.