Usage

Usage of pharext packaged extension PHARs.

Display the help message

$ ./raphf-1.0.5.ext.phar --help

Yields:

pharext v@dev-master (c) Michael Wallner <mike@php.net>

Usage:

  $ ./raphf-1.0.5.ext.phar [-hvqs] [-p|-n|-c|-i <arg>]

    -h|--help                      Display help
    -v|--verbose                   More output
    -q|--quiet                     Less output
    -p|--prefix <arg>              PHP installation prefix if phpize is not in $PATH, e.g. /opt/php7
    -n|--common-name <arg>         PHP common program name, e.g. php5 or zts-php [php]
    -c|--configure <arg>           Additional extension configure flags, e.g. -c --with-flag
    -s|--sudo [<arg>]              Installation might need increased privileges [sudo -S %s]
    -i|--ini <arg>                 Activate in this php.ini instead of loaded default php.ini
    --signature                    Show package signature
    --license                      Show package license
    --name                         Show package name
    --date                         Show package release date
    --release                      Show package release version
    --version                      Show pharext version

Switches explained

Output

Use -v or --verbose, if you want to see more (diagnostic) output, like that of phpize, ./configure and make.

Use -q or --quiet, if you want to see practically no output, unless some error occurs.

Prefix

Use -p or --prefix, if you want to choose the installation prefix of your PHP installation when is not in your $PATH, or you have multiple installations, e.g. /opt/php7.

An argument to this option is required.

Common name

Use -n or --common-name, if the PHP installation located at --prefix uses a custom common program name, like zts-php instead of just php.

An argument to this option is required.

Configuration

Use -c or --configure multiple times, if the extension defines custom configure switches needed for a successful build. This is usually the case when the extension wants an external library to build against.

An argument to this option is required.

Privileges

Use -s or --sudo with an optional argument, if you’re not operating as superuser and the final installation step needs elevated privileges. This option accepts an optional argument, which defines the command template to temporarily raise privileges; the default is sudo -S '%s' where ‘%s’ will be replaced with the command to run.

If the program needs a password of any form, please make sure that it asks for it with the occurrence of “Password” (case-insensitive); the password prompt will be forwarded and echoing on the terminal will be temporarily disabled, so you can securely input your passphrase.

INI

Use -i or --ini, if you want to specify a certain php.ini where extension activation should be performed. Be aware, that this step may also need elevated privileges.

An argument to this option is required.

Other

Any following switches were added by the extension.

In the example above, the switch --enable-raphf was added when the extension was packaged, which is essentially a short-cut for -c --enable-raphf. This option is merely informative, because the default is yes.

More often, though, there will be options like --with-libmemcached-dir for specifying non-standard locations where needed libraries are installed.

Dependencies

A pharext packaged extension might come loaded with its dependencies, which will be installed automatically prior installing the containing package.

Example with pecl_http

$ ./pecl_http-2.4.0dev.ext.phar -i /etc/php/conf.d/pecl.ini -s

Yields:

Installing propro-1.0.1.ext.phar ... 
Running phpize ... OK
Running configure ... OK
Running make ... OK
Running install ... OK
Running INI owner transfer ... OK
Running INI permission transfer ... OK
Running INI activation ... OK
Cleaning up /tmp/propro-1.0.1.ext.phar.54fdbc828e3ef ...
Installing raphf-1.0.5.ext.phar ... 
Running phpize ... OK
Running configure ... OK
Running make ... OK
Running install ... OK
Running INI owner transfer ... OK
Running INI permission transfer ... OK
Running INI activation ... OK
Cleaning up /tmp/raphf-1.0.5.ext.phar.54fdbc828e5e0 ...
Installing pecl_http-2.4.0dev.ext.phar ... 
Running phpize ... OK
Running configure ... OK
Running make ... OK
Running install ... OK
Running INI owner transfer ... OK
Running INI permission transfer ... OK
Running INI activation ... OK
Cleaning up /tmp/pecl_http-2.4.0dev.ext.phar.54fdbc828e1fb ...