php-config

php-config is a simple shell script for obtaining information about the installed PHP configuration.

When the extensions are being compiled, if multiple PHP versions are installed, the installation for which to build can be specified by using the --with-php-config option during configuration, setting the path of the respective php-config script.

The list of command line options provided by the php-config script can be queried anytime by running php-config with the -h switch:

 Usage: /usr/local/bin/php-config [OPTION] Options: --prefix [...] --includes [...] --ldflags [...] --libs [...] --extension-dir [...] --include-dir [...] --php-binary [...] --php-sapis [...] --configure-options [...] --version [...] --vernum [...] 

Command line options
OptionDescription
--prefixDirectory prefix where PHP is installed, e.g. /usr/local
--includes List of -I options with all include files
--ldflagsLD flags which PHP was compiled with
--libsExtra libraries which PHP was compiled with
--extension-dirDirectory where extensions are searched by default
--include-dir Directory prefix where header files are installed by default
--php-binaryFull path to php CLI or CGI binary
--php-sapisShow all SAPI modules available
--configure-options Configure options to recreate configuration of current PHP installation
--versionPHP version
--vernumPHP version as integer
To Top