Skip to content

Commit f5480e5

Browse files
committed
minor #9182 Documented the PhpExecutableFinder utility (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #9182). Discussion ---------- Documented the PhpExecutableFinder utility I was going to document #9003 ... but I think we should not explain that because it's an internal detail and the code can be changed/improved at any time and we cannot keep the docs in sync. However, we could document the PhpExecutableFinder utility if we decide is useful enough. Commits ------- cbd6e2b Documented the PhpExecutableFinder utility
2 parents 2761a8f + cbd6e2b commit f5480e5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/process.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,19 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and
350350
Moreover, you could not pass a callback to the ``start()``, ``run()`` or ``mustRun()``
351351
methods or use ``setIdleTimeout()``.
352352

353+
Finding the Executable PHP Binary
354+
---------------------------------
355+
356+
This component also provides a utility class called
357+
:class:`Symfony\\Component\\Process\\PhpExecutableFinder` which returns the
358+
absolute path of the executable PHP binary available on your server::
359+
360+
use Symfony\Component\Process\PhpExecutableFinder;
361+
362+
$phpBinaryFinder = new PhpExecutableFinder();
363+
$phpBinaryPath = $phpBinaryFinder->find();
364+
// $phpBinaryPath = '/usr/local/bin/php' (the result will be different on your computer)
365+
353366
.. _`Symfony Issue#5759`: https://github.com/symfony/symfony/issues/5759
354367
.. _`PHP Bug#39992`: https://bugs.php.net/bug.php?id=39992
355368
.. _`exec`: https://en.wikipedia.org/wiki/Exec_(operating_system)

0 commit comments

Comments
 (0)