首頁 >php教程 >php手册 >源码安装php5.5.7 php-fpm和xcache,以及xcache管理后台

源码安装php5.5.7 php-fpm和xcache,以及xcache管理后台

WBOY
WBOY原創
2016-06-13 09:46:051523瀏覽

一,安装前准备

cd /usr/local/src<br>

wget http://cn2.php.net/distributions/php-5.4.7.tar.gz

yum -y install gcc automake autoconf libtoolmake yum -y install gcc gcc-c++ glibc yum -y installlibmcrypt-devel mhash-devel libxslt-devel \ libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \ zlib zlib-devel glibc glibc-devel glib2 glib2-develbzip2bzip2-devel \ ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel \ krb5 krb5-devel libidn libidn-devel openssl openssl-devel<br> <br> 1、编译安装PHP 5.2.13所需的支持库:<br> tar zxvf libiconv-1.14.tar.gz<br> cd libiconv-1.13/<br> ./configure --prefix=/usr/local<br> make<br> make install<br> cd ../<br> <br> tar zxvf libmcrypt-2.5.8.tar.gz<br> cd libmcrypt-2.5.8/<br> ./configure<br> make<br> make install<br> /sbin/ldconfig<br> cd libltdl/<br> ./configure --enable-ltdl-install<br> make<br> make install<br> cd ../../<br> <br> tar zxvf mhash-0.9.9.9.tar.gz<br> cd mhash-0.9.9.9/<br> ./configure<br> make<br> make install<br> cd ../<br> <br> tar zxvf mcrypt-2.6.8.tar.gz<br> cd mcrypt-2.6.8/<br> /sbin/ldconfig<br> ./configure<br> make<br> make install<br> cd ../<br>

二。开始安装

tar zvxf php-5.5.7.tar.gz cd php-5.5.7<br> ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap<br> make ZEND_EXTRA_LIBS='-liconv' (记得这个,否则变异不过去)<br> make install<br> <br> 如果找不到php.ini ,把当前目录php.ini-product 复制到 /usr/local/php/lib 下,然后配置php.ini<br> 然后配置你得php-fpm.conf. 在/usr/local/etc/下,<br> mv php-fpm.conf.default php-fpm.conf<br> <br> 三 安装pdo mysql<br> <br> tar zxvf PDO_MYSQL-1.0.2.tgz<br> cd PDO_MYSQL-1.0.2/<br> /usr/local/php/bin/phpize<br> ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql<br> make<br> make install<br> cd ../<br> <br> 如果报错.ln -s /usr/local/mysql/include /usr/local/include<br> <br> 这是因为找不到到mysql的头文件<br> <br> 四,安装xcache<br> <br> wget http://xcache.lighttpd.net/wiki/Release-3.1.0<br> tar zxvf xcache-3.1.0<br> /usr/local/php/bin/phpize<br> ./configure --with-php-config=/usr/local/php/bin/php-config --enable-xcache --enable-xcache-optimizer

make <br>

make install

五 配置xcache

cat xcache.ini >> /etc/php.ini

<pre class="code">echo -n"12345"|md5sum

替换成你想要得用户名,和上面生成密码
<pre class="code">xcache.admin.user = "mOo"
xcache.admin.pass = "5f4dcc3b5aa765d61d8327deb882cf99"

安装后台管理
<pre class="code">cp -a ~/src/xcache/htdocs /var/www/example.com/htdocs/xcache-admin

<pre class="code"><pre class="code"><pre class="code"><pre class="code">/var/www/example.com/htdocs为你的网站目录



<br> <br>

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn