因爲一直沒升級系統版本,php也一直用的是系統默認的,致使新的一些東西用起來會有問題,php
好比 composer ... 以前一直 沒去理會,此次有個資源在github上沒找到,想了想還必須弄弄這個東西了,廢話很少說了,流水帳以下:mysql
系統版本: os x 10.9.5 php5.4.45 php配置簡記git
'/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'
-------------Startgithub
建立並進入安裝目錄sql
https://getcomposer.org/download/ apache
根據官網提示 進行安裝bootstrap
$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 版本太低bash
brew updateapp
...composer
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
更新成功:)