Skip to content

Commit cbd6e2b

Browse files
committed
Documented the PhpExecutableFinder utility
1 parent b749bf0 commit cbd6e2b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

components/process.rst

+13
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)