haxcop

Q: Need to install pear on OSX Server el capitan

HI Guys,

I'm doing some local sites on osx server el capitant last updated version but i need to install pear php .

can someone help me or guide me how to, becase in a traditional ways doesn't work to me.

https://coolestguidesontheplanet.com/installing-pear-on-osx-10-11-el-capitan/

MacBook Pro (13-inch Early 2011), OS X Yosemite (10.10), OS X SERVER APP 4+

Posted on Jun 9, 2016 5:00 PM

Close

Q: Need to install pear on OSX Server el capitan

  • All replies
  • Helpful answers

  • by pterobyte,

    pterobyte pterobyte Jun 10, 2016 3:13 AM in response to haxcop
    Level 6 (11,101 points)
    Servers Enterprise
    Jun 10, 2016 3:13 AM in response to haxcop

    What exactly is not working for you? What errors are you seeing?

  • by haxcop,

    haxcop haxcop Jun 10, 2016 12:37 PM in response to pterobyte
    Level 1 (4 points)
    Servers Enterprise
    Jun 10, 2016 12:37 PM in response to pterobyte

    Hi I am trying to install Pear to run some websites.

    This is the process that i ran and the end error.

     

    osxserver:~ local$ curl -O  http://pear.php.net/go-pear.phar

      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                     Dload  Upload   Total   Spent    Left  Speed

    100 3482k  100 3482k    0     0  1150k      0  0:00:03  0:00:03 --:--:-- 1150k

    osxserver:~ local$ php -d detect_unicode=0 go-pear.phar

     

    Below is a suggested file layout for your new PEAR installation.  To

    change individual locations, type the number in front of the

    directory.  Type 'all' to change all of them or simply press Enter to

    accept these locations.

     

    1. Installation base ($prefix)                   : /Users/local/pear

    2. Temporary directory for processing            : /tmp/pear/install

    3. Temporary directory for downloads             : /tmp/pear/install

    4. Binaries directory                            : /Users/local/pear/bin

    5. PHP code directory ($php_dir)                 : /Users/local/pear/share/pear

    6. Documentation directory                       : /Users/local/pear/docs

    7. Data directory                                : /Users/local/pear/data

    8. User-modifiable configuration files directory : /Users/local/pear/cfg

    9. Public Web Files directory                    : /Users/local/pear/www

    10. System manual pages directory                 : /Users/local/pear/man

    11. Tests directory                               : /Users/local/pear/tests

    12. Name of configuration file                    : /Users/local/.pearrc

     

    1-12, 'all' or Enter to continue:

    Beginning install...

    Configuration written to /Users/local/.pearrc...

    Initialized registry...

    Preparing to install...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.0.tar...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.1.tar ...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.1.tar...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.t ar...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.3.0.tar...

    install ok: channel://pear.php.net/Archive_Tar-1.4.0

    install ok: channel://pear.php.net/Console_Getopt-1.4.1

    install ok: channel://pear.php.net/Structures_Graph-1.1.1

    install ok: channel://pear.php.net/XML_Util-1.3.0

    install ok: channel://pear.php.net/PEAR-1.10.1

    PEAR: Optional feature webinstaller available (PEAR's web-based installer)

    PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)

    PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)

    PEAR: To install optional features use "pear install pear/PEAR#featurename"

     

    ******************************************************************************

    WARNING!  The include_path defined in the currently used php.ini does not

    contain the PEAR PHP directory you just specified:

    </Users/local/pear/share/pear>

    If the specified directory is also not in the include_path used by

    your scripts, you will have problems getting any PEAR packages working.

     

     

    Would you like to alter php.ini </etc/php.ini>? [Y/n] : Y

     

    ******************************************************************************

    WARNING: Cannot write to /etc/php.ini, but php.ini was successfully created

    at </Users/local/pear/php.ini-gopear>. Please replace the file </etc/php.ini> with

    </Users/local/pear/php.ini-gopear> or modify your php.ini by adding:

     

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

     

     

    Current include path           : .:

    Configured directory           : /Users/local/pear/share/pear

    Currently used php.ini (guess) : /etc/php.ini

    Press Enter to continue:

     

    ** WARNING! Old version found at /Users/local/pear/bin, please remove it or be sure to use the new /Users/local/pear/bin/pear command

     

    The 'pear' command is now at your service at /Users/local/pear/bin/pear

     

    ** The 'pear' command is not currently in your PATH, so you need to

    ** use '/Users/local/pear/bin/pear' until you have added

    ** '/Users/local/pear/bin' to your PATH environment variable.

     

    Run it without parameters to see the available actions, try 'pear list'

    to see what packages are installed, or 'pear help' for help.

     

    For more information about PEAR, see:

     

      http://pear.php.net/faq.php

      http://pear.php.net/manual/

     

    Thanks for using go-pear!

     

    osxserver:~ local$

     


    How can I solve this.

    Thanks in Advance

  • by pterobyte,

    pterobyte pterobyte Jun 13, 2016 1:54 AM in response to haxcop
    Level 6 (11,101 points)
    Servers Enterprise
    Jun 13, 2016 1:54 AM in response to haxcop

    You should use:

    /usr/local/...

    and not

    /Users/local/...

     

    (or change the paths in php.ini, but since /usr/local is a standard location, I wouldn't do that)

  • by haxcop,

    haxcop haxcop Jun 13, 2016 2:45 AM in response to pterobyte
    Level 1 (4 points)
    Servers Enterprise
    Jun 13, 2016 2:45 AM in response to pterobyte

    HI Thanks for your reply. I just tried again changing the path to usr but still getting some errors like.

     

    1-12, 'all' or Enter to continue:

    Beginning install...

    Configuration written to /private/etc/pear.conf...

    Initialized registry...

    Preparing to install...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.0.tar...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.1.tar ...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.1.tar...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.t ar...

    installing phar:///Users/local/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.3.0.tar...

    install ok: channel://pear.php.net/Archive_Tar-1.4.0

    install ok: channel://pear.php.net/Console_Getopt-1.4.1

    install ok: channel://pear.php.net/Structures_Graph-1.1.1

    install ok: channel://pear.php.net/XML_Util-1.3.0

    install ok: channel://pear.php.net/PEAR-1.10.1

    PEAR: Optional feature webinstaller available (PEAR's web-based installer)

    PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)

    PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)

    PEAR: To install optional features use "pear install pear/PEAR#featurename"

     

    ******************************************************************************

    WARNING!  The include_path defined in the currently used php.ini does not

    contain the PEAR PHP directory you just specified:

    </usr/local/pear/share/pear>

    If the specified directory is also not in the include_path used by

    your scripts, you will have problems getting any PEAR packages working.

     

     

    Would you like to alter php.ini </etc/php.ini>? [Y/n] : y

     

    php.ini </etc/php.ini> include_path updated.

     

    Current include path           : .:

    Configured directory           : /usr/local/pear/share/pear

    Currently used php.ini (guess) : /etc/php.ini

    Press Enter to continue:

     

    ** WARNING! Old version found at /usr/local/pear/bin, please remove it or be sure to use the new /usr/local/pear/bin/pear command

     

    The 'pear' command is now at your service at /usr/local/pear/bin/pear

     

    ** The 'pear' command is not currently in your PATH, so you need to

    ** use '/usr/local/pear/bin/pear' until you have added

    ** '/usr/local/pear/bin' to your PATH environment variable.

     

    Run it without parameters to see the available actions, try 'pear list'

    to see what packages are installed, or 'pear help' for help.

     

    For more information about PEAR, see:

     

      http://pear.php.net/faq.php

      http://pear.php.net/manual/

     

    Thanks for using go-pear!

     

    sh-3.2# cd

    sh-3.2# nano .bash_profile

    sh-3.2# export PATH="/usr/local/mysql/bin:/usr/local/pear/share/pear/:$PATH"

    sh-3.2# source .bash_profile

    sh: /usr/local/pear/bin: is a directory

    sh-3.2# pear version

    sh: pear: command not found

    sh-3.2#

    sh-3.2# PEAR version

    sh: PEAR: command not found

    sh-3.2# pear version

    sh: pear: command not found

    sh-3.2# php --ini

    Configuration File (php.ini) Path: /etc

    Loaded Configuration File:         /etc/php.ini

    Scan for additional .ini files in: /Library/Server/Web/Config/php

    Additional .ini files parsed:      /Library/Server/Web/Config/php/php.ini

     

    sh-3.2# vim /etc/php.ini

    sh-3.2# pear list

    sh: pear: command not found

    sh-3.2# pear list

    sh: pear: command not found

    sh-3.2# pear upgrade pear

    sh: pear: command not found

    sh-3.2# pear install PHP_codesniffer

    sh: pear: command not found

    sh-3.2#

    sh-3.2#

  • by pterobyte,

    pterobyte pterobyte Jun 13, 2016 2:50 AM in response to haxcop
    Level 6 (11,101 points)
    Servers Enterprise
    Jun 13, 2016 2:50 AM in response to haxcop

    Looks like you have multiple versions installed. Probably from different attempts with different methods. Either run pear by prepending its path "/usr/local/pear/bin" or add "/usr/local/pear/bin" to your $PATH variable.

  • by haxcop,Solvedanswer

    haxcop haxcop Jun 13, 2016 4:14 AM in response to pterobyte
    Level 1 (4 points)
    Servers Enterprise
    Jun 13, 2016 4:14 AM in response to pterobyte

    Thank for your reply. At the end I found in http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/ a guide that solved my issue pretty simple.

     

    Download PEAR

    curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar 

    Configure and Install PEAR

    You should now be at a prompt to configure PEAR.

    1. Type 1 and press return.
    2. Enter:
      /usr/local/pear 
    3. Type 4 and press return.
    4. Enter:
      /usr/local/bin 
    5. Press return

    Verify PEAR

    You should be able to type:

    pear version