CentOS 6.6 下Apache+PHP+Mysql編譯安裝

CentOS6.6下yum庫中php版本爲5.4,mysql5.1,有時候咱們可能須要不一樣的版本。好比,你的php開發使用laraval5.2,你須要的php版本是>5.5.9。那麼你就須要本身編譯安裝相應的軟件。php

#Apache httpd 2.4 1.下載apr-1.5.2.tar.gzmysql

tar -zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install

2.下載apr-util-1.5.4.tar.gzsql

tar -zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

3.下載pcre-8.37.tar.gzapache

tar -zxvf pcre-8.37.tar.gz
cd pcre-8.37
./configure
make && make install

4.下載 httpd-2.4.20.tar.gzdom

tar -xzf httpd-2.4.20.tar.gz
cd httpd-2.4.20
./configure --prefix=/usr/local/apache \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--enable-module=so \
--enable-mods-shared=all \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-cache \
--enable-file-cache \
--enable-mem-cache \
--enable-disk-cache \
--enable-mime-magic \
--enable-authn-dbm \
--enable-vhost-alias \
--enable-so \
--enable-rewrite \
--enable-ssl
make && make install

5.測試 修改配置,ServerName=...curl

/usr/local/apache/bin/httpd -k start

若是本機socket

curl localhost

能夠訪問,外網沒法訪問,則是防火牆未開發相應端口tcp

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

#Mysql mysql 5.5以後的版本須要cmake編譯,參考這篇博客已經寫的很詳細了,readme有更多狀況的描述。測試

#php 下載php-5.6.21.tar.gzurl

tar -zxvf php-5.6.21.tar.gz
cd php-5.6.21
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-pear \
--with-freetype-dir \
--with-zlib \
--with-libxml-dir \
--with-iconv-dir \
--with-xmlrpc \
--with-mhash \
--with-mcrypt \
--with-curl \
--with-openssl \
--with-snmp \
--with-gettext \
--enable-pdo \
--enable-mbstring \
--enable-ctype \
--enable-simplexml \
--enable-ftp \
--enable-sockets \
--enable-gd-native-ttf \
--enable-sysvsem \
--enable-exif \
--enable-sysvshm \
--enable-xml \
--enable-dom \
--enable-simplexml \
--enable-shmop \
--enable-zip \
--enable-mbregex \
--enable-bcmath \
--enable-inline-optimization \
--enable-soap
make && make install

遇到缺乏庫, yum install *-devel

相關文章
相關標籤/搜索