PHP

 
 
PHP (= Hypertext Preprocessor) is an HTML-embedded server-side scripting language.

PHP is distributed at no charge for commercial or non-commercial use. For more information read the LICENSE information.

More information about PHP can be found at: http://www.php.net

PHP manuals can be found at:
http://www.php.net/manual/en/
http://devzone.zend.com/manual/

The latest PHP version can be downloaded from: http://www.php.net/downloads.php






Install PEAR in PHP 5.6.30 on macOS Sierra



Information
PEAR (= PHP Extension and Application Repository) is a framework and distribution system for reusable PHP components.

More information about PEAR can be found at: http://pear.php.net

Operating system used
macOS Sierra

Software prerequisites
PHP 5.6.30


Procedure
  1. After you installed PHP, see quick guide Installing PHP5.6.30 on macOS Sierra,
    check if you already have PEAR installed, type: pear version

  2. If PEAR is not installed you need to download the PEAR installer (go-pear.phar).
    Goto your homedirectory and type: curl -O http://pear.php.net/go-pear.phar

  3. Install Pear, type: php -d detect_unicode=0 go-pear.phar

    Install PEAR step 1

    I accept the suggested locations, press Enter.

    Install PEAR step 2

  4. Edit .bash_profile and add the following line:
    export PATH=$PATH:/Users/robertlie/pear/bin

  5. Check the installed PEAR version, type: pear version

    You should see:

    PEAR Version: 1.10.1
    PHP Version: 5.6.30
    Zend Engine Version: 2.6.0
    Running on: Darwin MacBook.local 16.6.0 Darwin Kernel Version 16.6.0:
    Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64


  6. Locate your php.ini, type: php --ini

    You should see (This is my example!):

    Configuration File (php.ini) Path: /usr/local/php5/lib
    Loaded Configuration File: /usr/local/php5/lib/php.ini
    Scan for additional .ini files in: /usr/local/php5/php.d
    Additional .ini files parsed: /usr/local/php5/php.d/10-extension_dir.ini,
    /usr/local/php5/php.d/20-extension-opcache.ini,
    /usr/local/php5/php.d/40-curl.ini,
    /usr/local/php5/php.d/40-openssl.ini,
    /usr/local/php5/php.d/50-extension-apcu.ini,
    /usr/local/php5/php.d/50-extension-curl.ini,
    /usr/local/php5/php.d/50-extension-gmp.ini,
    /usr/local/php5/php.d/50-extension-igbinary.ini,
    /usr/local/php5/php.d/50-extension-imap.ini,
    /usr/local/php5/php.d/50-extension-intl.ini,
    /usr/local/php5/php.d/50-extension-mcrypt.ini,
    /usr/local/php5/php.d/50-extension-memcache.ini,
    /usr/local/php5/php.d/50-extension-memcached.ini,
    /usr/local/php5/php.d/50-extension-mongo.ini,
    /usr/local/php5/php.d/50-extension-mssql.ini,
    /usr/local/php5/php.d/50-extension-oauth.ini,
    /usr/local/php5/php.d/50-extension-pdo_dblib.ini,
    /usr/local/php5/php.d/50-extension-pdo_pgsql.ini,
    /usr/local/php5/php.d/50-extension-pgsql.ini,
    /usr/local/php5/php.d/50-extension-propro.ini,
    /usr/local/php5/php.d/50-extension-raphf.ini,
    /usr/local/php5/php.d/50-extension-readline.ini,
    /usr/local/php5/php.d/50-extension-redis.ini,
    /usr/local/php5/php.d/50-extension-solr.ini,
    /usr/local/php5/php.d/50-extension-ssh2.ini,
    /usr/local/php5/php.d/50-extension-twig.ini,
    /usr/local/php5/php.d/50-extension-uploadprogress.ini,
    /usr/local/php5/php.d/50-extension-xdebug.ini,
    /usr/local/php5/php.d/50-extension-xhprof.ini,
    /usr/local/php5/php.d/50-extension-xsl.ini,
    /usr/local/php5/php.d/60-extension-pecl_http.ini,
    /usr/local/php5/php.d/99-liip-developer.ini


  7. Modify your php.ini file. For example: /usr/local/php5/lib/php.ini
    Under "Paths and Directories" add the following line:

    include_path = ".:/Users/YOUR_USERNAME/pear/share/pear/"

    For example: include_path = ".:/Users/robertlie/pear/share/pear/"

  8. Restart Apache, type: sudo apachectl restart

  9. Show the installed PEAR packages, type: pear list

    You should see:
    Installed packages, channel pear.php.net:
    =========================================
    Package           Version State
    Archive_Tar       1.4.2   stable
    Console_Getopt    1.4.1   stable
    PEAR              1.10.3  stable
    Structures_Graph  1.1.1   stable
    XML_Util          1.4.2   stable
    
  10. To install PEAR packages, here are a few examples:
  11. Show the installed PEAR packages, type: pear list

    You should see:
    Installed packages, channel pear.php.net:
    =========================================
    Package           Version State
    Archive_Tar       1.4.2   stable
    Console_Getopt    1.4.1   stable
    HTTP_Request      1.4.4   stable
    Log               1.13.1  stable
    MDB2              2.5.0b5 beta
    MDB2_Driver_mysql 1.5.0b4 beta
    Mail              1.4.1   stable
    Mail_Mime         1.10.1  stable
    Mail_mimeDecode   1.5.6   stable
    Net_DIME          1.0.2   stable
    Net_Socket        1.2.2   stable
    Net_URL           1.0.15  stable
    PEAR              1.10.3  stable
    SOAP              0.13.0  beta
    Structures_Graph  1.1.1   stable
    XML_Util          1.4.2   stable