Skip to content

Instantly share code, notes, and snippets.

@krismas
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krismas/92e3e31674dbcfd7ba83 to your computer and use it in GitHub Desktop.
Save krismas/92e3e31674dbcfd7ba83 to your computer and use it in GitHub Desktop.
Try to find the best location for PHP binary
<?php
// Try to find the best location for PHP binary
$sPHP = ((isset($_SERVER['_']) && $_SERVER['_']) ? $_SERVER['_'] : (defined(PHP_BINARY) ? PHP_BINARY : (defined(PHP_BINDIR) ? PHP_BINDIR.'/php' : preg_replace(':/lib$:', '/bin/php', PHP_CONFIG_FILE_PATH))));
$sPHP = (is_executable($sPHP) ? $sPHP : 'php');
echo "$sPHP\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment