SSH2 extended installation required for PHP access to SFTP in OS X systems

Source: Internet
Author: User
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%
==> 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%
==> Pouring gettext-0.19.2.mavericks.bottle.tar.gz
==> Caveats
This formula are 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 is in the library path.
Generally there is no consequences of this. If You build your
Own software and it requires this formula, you'll need to the 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%
==> Pouring icu4c-53.1.mavericks.bottle.tar.gz
==> Caveats
This formula are keg-only, which means it was not symlinked into/usr/local.
Conflicts; see:https://github.com/homebrew/homebrew/issues/issue/167
Generally there is no consequences of this. If You build your
Own software and it requires this formula, you'll need to the 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%
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, 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 on 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 is 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 have a issues with a custom extension compiling, ensure that
You is using the brew version, by Placing/usr/local/bin Before/usr/sbin in your PATH:
Path= "/usr/local/bin: $PATH"
PHP54 Extensions'll 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 has 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%
==> 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%
==> 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 are there been successful!
*
* Using PHP from the command line:
*-Run "php-i" (Command-Line "phpinfo ()")
*-Look for the info on the SSH2 module.
*-If you are there been successful!
==> Summary
? /usr/local/cellar/php54-ssh2/0.12:3 files, 72K, built in seconds
andy@andymacbookpro:/usr/local/src$

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the installation of PHP in OS X system that requires SSH2 extension when accessing SFTP, including the contents of the content, I hope to be interested in PHP tutorial friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.