您好,登錄后才能下訂單哦!
1、下載php
wget http://cn2.php.net/distributions/php-5.6.0.tar.gz
2、安裝相關組件
yum install gcc gcc-c++ curl-devel bzip2 bzip2-devel openssl openssl-devel libxml2-devel libjpeg libjpeg-devel libmcrypt* libpng-devel
3、編譯
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql/ --with-apxs2=/usr/local/httpd/bin/apxs --enable-mbstring --with-gd --with-zlib --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --with-mcrypt --with-openssl --with-mysqli --with-mysql-sock --enable-gd-native-ttf --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql - -enable-fpm
make
make install
4、設置php
cp php.ini-development /usr/local/php/lib/php.ini
5、是apapche支持php
vi /usr/local/httpd/conf/httpd.conf
查找字符串AddType,并增加
AddType application/x-httpd-php .php .php3 .htm .phtml .php4
AddType application/x-httpd-php-source .phps
查找字符串DirectoryIndex,并修改為
DirectoryIndex index.html index.php3 index.php default.php
6、nginx開啟php支持
# ln -s /usr/local/php/etc/php.ini /etc/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# vi /usr/local/php/etc/php-fpm.conf
user = www
group = www
#取消前面的分號 pid = run/php-fpm.pid
設置php-fpm開機啟動
vi /etc/rc.local 加入
/usr/local/php/sbin/php-fpm
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。