您的位置:首页 > 编程语言 > PHP开发

mac10.9.5 php5.4.45安装composer 简记

2016-06-15 12:40 609 查看
由于一直没升级系统版本,php也一直用的是系统默认的,导致新的一些东西用起来会有问题,
比如 composer ... 之前一直 没去理会,这次有个资源在github上没找到,想了想还必须弄弄这个东西了,废话不多说了,流水账如下:
系统版本: os x 10.9.5 php5.4.45 php配置简记
'/private/var/tmp/apache_mod_php/apache_mod_php-87.10~1/php/configure'
'--prefix=/usr'
'--mandir=/usr/share/man'
'--infodir=/usr/share/info'
'--disable-dependency-tracking'
'--sysconfdir=/private/etc'
'--with-apxs2=/usr/sbin/apxs'
'--enable-cli'
'--with-config-file-path=/etc'
'--with-config-file-scan-dir=/Library/Server/Web/Config/php'
'--with-libxml-dir=/usr'
'--with-openssl=/usr'
'--with-kerberos=/usr'
'--with-zlib=/usr'
'--enable-bcmath'
'--with-bz2=/usr'
'--enable-calendar'
'--disable-cgi'
'--with-curl=/usr'
'--enable-dba'
'--enable-ndbm=/usr'
'--enable-exif'
'--enable-fpm'
'--enable-ftp'
'--with-gd'
'--with-freetype-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.10~1/Root/usr/local'
'--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.10~1/Root/usr/local'
'--with-png-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.10~1/Root/usr/local'
'--enable-gd-native-ttf'
'--with-icu-dir=/usr'
'--with-ldap=/usr'
'--with-ldap-sasl=/usr'
'--with-libedit=/usr'
'--enable-mbstring'
'--enable-mbregex'
'--with-mysql=mysqlnd'
'--with-mysqli=mysqlnd'
'--without-pear'
'--with-pdo-mysql=mysqlnd'
'--with-mysql-sock=/var/mysql/mysql.sock'
'--with-readline=/usr'
'--enable-shmop'
'--with-snmp=/usr'
'--enable-soap'
'--enable-sockets'
'--enable-sqlite-utf8'
'--enable-sysvmsg'
'--enable-sysvsem'
'--enable-sysvshm'
'--with-tidy'
'--enable-wddx'
'--with-xmlrpc'
'--with-iconv-dir=/usr'
'--with-xsl=/usr'
'--enable-zend-multibyte'
'--enable-zip'
'--with-pcre-regex=/usr'
-------------Start
创建并进入安装目录
https://getcomposer.org/download/
根据官网提示 进行安装
$php composer-setup.php
Downloading 1.1.2...

Composer successfully installed to: /data/codes/study/php/composer/composer.phar
Use it: php composer.phar
Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:

The OpenSSL library (0.9.8zd) used by PHP does not support TLSv1.2 or TLSv1.1.
If possible you should upgrade OpenSSL to version 1.0.1 or above.
完成后 提示 openssl 版本过低
brew update
...
brew upgrade openssl
$brew upgrade openssl
==> Upgrading 1 outdated package, with result:
openssl 1.0.2h_1
==> Upgrading openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2h_1.mavericks.bottle.tar.gz ######################################################################## 100.0%
==> Pouring openssl-1.0.2h_1.mavericks.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs

and run
/usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

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/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
/usr/local/Cellar/openssl/1.0.2h_1: 1,691 files, 12.3M
升级完系统的openssl 之后
重新编译安装php openssl 扩展
修改php.ini
重启php-fpm
然后发现openssl扩展加载 冲突
原来编译的时候 已经默认开启了, 移除 /usr/bin/openssl 重新建立软链
sudo ln -s /usr/local/opt/openssl/bin/openssl /usr/bin/openssl
重启php-fpm 依然载入的不是新的openssl

看来只能重新编译安装php了, 先备份删除系统默认的php
去php官网下载对应的源码包,移除系统默认配置中 apache 相关的配置项
修改
--with-openssl=/usr/local/opt/openssl
配置后 sudo make ... sudo make install ...
然后移除刚刚配置的多余扩展 openssl.so
启动php-fpm 查看phpinfo



更新成功:)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  php mac composer