专注于高品质PHP技术等信息服务于一体 [STIEMAP] [RSS]

百度提供的广告:
Linux
当前位置:首页 > 技术文档 > Linux >  > 
MacPorts 安装软件包
MacPorts 类似于 yum 是软件包管理器,不过,没有 yum 用户量大,存在问题比较多。
http://www.macports.org/install.php
10.9 的下载地址
https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.9-Mavericks.pkg
ps: 安装时间非常慢,大概15分钟,请耐心等待。
 
用法:
port selfupdate     #先更新版本库
port search name    #搜索一个软件
port install name   # 安装一个软件
port uninstall name # 删除一个软件


将安装好的软件加入到环境变量中否则找不到库
export PATH=$PATH:/opt/local/bin
export PATH=$PATH:/opt/local/sbin/

所有要安装的库,全部在 /opt 下。
试着安装PHP 所需的库。
port install curl
port install gd2

编译安装PHP
./configure --prefix=/usr/local/php5 --enable-gd-native-ttf  --enable-gd-jis-conv  --enable-mbstring\
  --enable-sockets  --enable-zip  --with-curl  --with-gd  --with-jpeg-dir   --with-png-dir\
  --with-freetype-dir  --with-iconv-dir\
  --with-mysql  --with-apxs2=/usr/sbin/apxs\

失败找不到 libjpeg.h 
加个链接
ln -s /opt/local/include/libjpeg.h /usr/include/libjpeg.h

找不到 gd
./configure --prefix=/usr/local/php5 --enable-gd-native-ttf  --enable-gd-jis-conv  --enable-mbstring\
  --enable-sockets  --enable-zip  --with-curl  --with-gd  --with-jpeg-dir=/opt/local/lib    --with-png-dir\
  --with-freetype-dir  --with-iconv-dir\
  --with-mysql  --with-apxs2=/usr/sbin/apxs\

还是不行 64_86 架构不支持,gcc 不能链接出来 libphp5.so 手动 加个 -m32 参数,可以编译出来了,但 make install 失败。
算了以后在弄吧,期待下文。