mariadb10.0.14
請參看:源碼安裝MariaDB10
php5.6.8
一.編譯安裝php
A.安裝編譯工具和依賴庫
[root@test1 ~]#yum -y install gcc gcc-c++ libxml2-devel openssl-devel pcre-devel libcurl-devel gd-devel bzip2-devel freetype-devel giflib-devel openjpeg-devel readline-devel libedit-devel
B.編譯php擴展庫
libmcrypt
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt
[root@test1 ~]#
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
[root@test1 ~]
# tar -zxvf libmcrypt-2.5.7.tar.gz -C /usr/local/src
[root@test1 ~]
# cd /usr/local/src/libmcrypt-2.5.7
[root@test1
libmcrypt-2.5.7]
# ./configure && make && make install
[root@test1 ~]
#ldconfig
mhash
http://sourceforge.net/projects/mhash/files/
[root@test1 ~]
# tar -jxvf mhash-0.9.9.9.tar.bz2 -C /usr/local/src
[root@test1 ~]
# cd /usr/local/src/mhash-0.9.9.9/
[root@test1 mhash-0.9.9.9]
# ./configure && make && make install
[root@test1 ~]
#ldconfig
mcrypt
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic
[root@test1 ~]
# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/mcrypt-2.6.4.tar.gz
[root@test1 ~]
# tar -zxvf
mcrypt-2.6.4.tar.gz
-C /usr/local/src
[root@test1 ~]
# cd /usr/local/src/mcrypt-2.6.4
[root@test1
mcrypt-2.6.4]
# LD_LIBRARY_PATH=/usr/local/lib ./configure && make && make install
[root@test1 ~]
#ldconfig
注意:上面標紅的部分必定不能省,否則會報以下錯誤
checking for libmcrypt -
version >= 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location
Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying
LD_LIBRARY_PATH
***
configure: error: ***
libmcrypt was not found
說明:若是提示GD庫找不到,能夠再從新源碼安裝下GD庫
(可選)
libgd
http://libgd.bitbucket.org/
http://autosetup1.googlecode.com/files
[root@test1 ~]
#
wget http://autosetup1.googlecode.com/files/gd-2.0.35.tar.gz
[root@test1 ~]
#
tar -zxvf gd-2.0.35.tar.gz -C /usr/local/src/
[root@test1 ~]
#
cd /usr/local/src/gd-2.0.35/
[root@test1 gd-2.0.35]#
./configure && make && make install
[root@test1 ~]
#ldconfig
gd庫很重要,諸如dedeCMS, DiscuzX!,PHPwind等建站框架都須要gd庫支持,而且官方下載的gd庫一直安裝不成功,因此這裏才用了第三方的地址。
C.編譯php-fpm
新建用戶和用戶組
groupadd -r php-fpm
useradd -r php-fpm -g php-fpm
php
http://cn2.php.net/get/php-5.6.8.tar.xz/from/a/mirror
[root@test1 ~]
# tar -xvf php-5.6.8.tar.xz -C /usr/local/src
[root@test1 ~]
# cd /usr/local/src/php-5.6.8
[root@test1
php-5.6.8]# ./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/usr/local/php/etc/php.d \
--with-fpm-user=php-fpm \
--with-fpm-group=php-fpm \
--enable-inline-optimization \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--enable-shared \
--enable-opcache \
--enable-bcmath \
--enable-soap \
--enable-zip \
--enable-gd-native-ttf \
--enable-ftp \
--enable-fpm \
--enable-mbstring \
--enable-calendar \
--enable-dom \
--enable-xml \
--with-pear \
--with-pcre-regex \
--with-curl \
--with-bz2 \
--with-zlib \
--with-gd \
--with-gettext \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-iconv-dir=/usr/local \
--with-freetype-dir=/usr/local \
--with-libxml-dir=/usr/local \
--with-readline \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-openssl \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--disable-debug \
--disable-fileinfo
[root@test1 php-5.6.8]#
make && make install
注意:
編譯出現錯誤
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
這是因爲內存小於1G所致使,解決辦法在./configure加上選項:
--disable-fileinfo #禁用 fileinfo
--enable-mbstring #
phpMyadmin4須要mbstring支持,編譯時能夠加上