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配置简记
创建并进入安装目录
https://getcomposer.org/download/
根据官网提示 进行安装
brew update
...
brew upgrade 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 相关的配置项
修改
然后移除刚刚配置的多余扩展 openssl.so
启动php-fpm 查看phpinfo
更新成功:)
比如 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
更新成功:)
相关文章推荐
- 一个关于if else容易迷惑的问题
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- 什么是设计模式
- 什么是Mac OS X?跟Linux有什么区别
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- PHP数据库长连接mysql_pconnect的细节
- Php Installing An Expansion
- rem : web app适配的秘密武器
- jquery高级应用之Deferred对象
- php7 读取php.ini[4]
- Linux vs Mac:Linux 比 Mac 好的 7 个原因
- 苹果mac OS X上安装metasploit
- Mac OS上安装PostgreSQL的教程
- PHP+Apache在Windows 9x下的安装和配置
- IIS 6 的 PHP 最佳配置方法