Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Benson Ottergoose

View GitHub Profile
@LucaRosaldi
LucaRosaldi / distance-sample.php
Last active Aug 16, 2021
PHP: Get Distance Between two Geolocated Points (lat/lon)
View distance-sample.php
<?php
/* These are two points in New York City */
$point1 = array('lat' => 40.770623, 'long' => -73.964367);
$point2 = array('lat' => 40.758224, 'long' => -73.917404);
$distance = getDistanceBetweenPoints($point1['lat'], $point1['long'], $point2['lat'], $point2['long']);
foreach ($distance as $unit => $value) {
echo $unit.': '.number_format($value,4).'<br />';
}
@litzinger
litzinger / 0-Debugging-ExpressionEngine.md
Last active Nov 1, 2021
How to show errors when you get a white screen in EE. Turning up the debugging will reveal PHP errors.
View 0-Debugging-ExpressionEngine.md

Overview

Below are two techniques to help debug the WSOD (white screen of death), usually a 500 server error, in an ExpressionEngine site. The Basic-Debugging option will be suitable in most cases and is specific to ExpressionEngine. The Advanced-Debugging is generic and applicable to any PHP based software. If the basic debugging does not work, try the advanced.

If you get a WSOD you will need to first get your site to reveal an error before reporting it to EllisLab or the add-on developer. Simply reporting "I get a white screen" does not give the developer enough information to assist you. An error message on the other hand will point the developer to the source of the issue.