mac php 编译安装

1)下载libiconv,下载地址:wget http://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz

2)编译安装libiconv

tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make && make install

3)下载Php 下载地址:sudo wget http://distfiles.macports.org/php5/php-5.3.28.tar.bz2

4)解压Php

tar xf php-5.3.29.tar.gz

cd php-5.3.29

5)编译php包

./configure \
--prefix=/usr/local/Cellar/php5.3.28\
--with-apxs2=/usr/local/bin/apxs \
--with-mysql=/usr/local/Cellar/mysql@5.6/5.6.39 \
--with-xmlrpc \
--with-openssl=/usr/local/Cellar/openssl/1.0.2o_1/
--with-zlib \
--with-freetype-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-iconv=/usr/local/libiconv \
--enable-short-tags \
--enable-sockets \
--enable-zend-multibyte \
--enable-soap \
--enable-mbstring \
--enable-static \
--enable-gd-native-ttf \
--with-curl \
--with-xsl \
--enable-ftp \
--with-libxml-dir

6)安装Php

make && make install

7)更改内容

<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

 

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

 

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011364306/article/details/50474483

posted @ 2018-04-19 00:40  听风忆雨丶  阅读(2526)  评论(0编辑  收藏  举报