Function __global->find_php_path

Definitions

sources/files2.php

  • Find path to the PHP executable.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$cgi boolean No No False N/A N/A Whether we need a CGI interpreter

Returns

  • Path to PHP (or just raw php command if cannot find a full path)
  • Type: PATH
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find path to the PHP executable.
 *
 * @param  boolean $cgi Whether we need a CGI interpreter
 * @return PATH Path to PHP (or just raw php command if cannot find a full path)
 */

function find_php_path(bool $cgi = false) : string