andy@AndyMacBookPro:/usr/local/src$ php -v
PHP 5.4.40 (cli) (built: May 3 2015 22:07:42)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
andy@AndyMacBookPro:/usr/local/src$ brew search ssh2
libssh2 php53-ssh2 php54-ssh2 php55-ssh2 php56-ssh2
^C^C^C
/usr/local/Library/brew.rb: Interrupt
andy@AndyMacBookPro:/usr/local/src$ brew install php54-ssh2
==> Installing dependencies for php54-ssh2: libpng, gettext, icu4c, php54
==> Installing php54-ssh2 dependency: libpng
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.
######################################################################## 100.0%
==> Pouring libpng-1.6.13.mavericks.bottle.tar.gz
?? /usr/local/Cellar/libpng/1.6.13: 17 files, 1.2M
==> Installing php54-ssh2 dependency: gettext
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/gettext-0.1
######################################################################## 100.0%
==> Pouring gettext-0.19.2.mavericks.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Mac OS X provides similar software, and installing this software in
parallel can cause all kinds of trouble.
OS X provides the BSD gettext library and some software gets confused if both are in the library path.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/gettext/lib
CPPFLAGS: -I/usr/local/opt/gettext/include
==> Summary
?? /usr/local/Cellar/gettext/0.19.2: 1920 files, 18M
==> Installing php54-ssh2 dependency: icu4c
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/icu4c-53.1.
######################################################################## 100.0%
==> Pouring icu4c-53.1.mavericks.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
Conflicts; see: https://github.com/Homebrew/homebrew/issues/issue/167
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/icu4c/lib
CPPFLAGS: -I/usr/local/opt/icu4c/include
==> Summary
?? /usr/local/Cellar/icu4c/53.1: 241 files, 57M
==> Installing php54-ssh2 dependency: php54
==> Downloading http://www.php.net/get/php-5.4.32.tar.bz2/from/this/mirror
######################################################################## 100.0%
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
of homebrew-php, or you are using a non-standard
pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php54/5.4.32 --localstatedir=/usr/loc
==> make
==> make install
==> /usr/local/Cellar/php54/5.4.32/bin/pear config-set php_ini /usr/local/etc/ph
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/php54/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.4/php.ini
???? PEAR ????
If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php54/5.4.32/lib/php
pear config-set php_ini /usr/local/etc/php/5.4/php.ini
???? Extensions ????
If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:
PATH="/usr/local/bin:$PATH"
PHP54 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.
???? PHP CLI ????
If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:
export PATH="$(brew --prefix homebrew/php/php54)/bin:$PATH"
To have launchd start php54 at login:
ln -sfv /usr/local/opt/php54/*.plist ~/Library/LaunchAgents
Then to load php54 now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php54.plist
==> Summary
?? /usr/local/Cellar/php54/5.4.32: 489 files, 38M, built in 7.6 minutes
==> Installing php54-ssh2 dependency: libssh2
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libssh2-1.4
######################################################################## 100.0%
==> Pouring libssh2-1.4.3_1.mavericks.bottle.tar.gz
?? /usr/local/Cellar/libssh2/1.4.3_1: 177 files, 1.3M
==> Installing php54-ssh2
==> Downloading http://pecl.php.net/get/ssh2-0.12.tgz
######################################################################## 100.0%
==> PHP_AUTOC/usr/local/opt/autoconf/bin/autoconf" PHP_AUTOHEADER="/usr/loc
==> ./configure --prefix=/usr/local/Cellar/php54-ssh2/0.12 --with-php-c>==> make
==> Caveats
To finish installing ssh2 for PHP 5.4:
* /usr/local/etc/php/5.4/conf.d/ext-ssh2.ini was created,
do not forget to remove it upon extension removal.
* Validate installation via one of the following methods:
*
* Using PHP from a webserver:
* - Restart your webserver.
* - Write a PHP page that calls "phpinfo();"
* - Load it in a browser and look for the info on the ssh2 module.
* - If you see it, you have been successful!
*
* Using PHP from the command line:
* - Run "php -i" (command-line "phpinfo()")
* - Look for the info on the ssh2 module.
* - If you see it, you have been successful!
==> Summary
?? /usr/local/Cellar/php54-ssh2/0.12: 3 files, 72K, built in 10 seconds
andy@AndyMacBookPro:/usr/local/src$
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了在OS X系统中php访问sftp时需要ssh2扩展的安装,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。