新聞中心
***********安裝php*******************
1,包:php-5.4.26.tar.bz2 xcache-3.0.3.tar.bz2 phpMyAdmin-4.0.5-all-languages.zip
依賴包安裝(X Software Development )
yum groupinstall "Desktop Platform Development" -y
2,如果想讓編譯的PHP支持mcrypt,還需要安裝
yum -y install libmcrypt-2.5.7.e15.i386.rpm
yum -y install libmcrypt-devel-2.5.7-5.e15.i386.rpm
安裝epel YUM源
rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum -y install libmcrypt-devel
3,解壓安裝php
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts
如果為了Apache支持works或event這兩個(gè)MPM,編譯時(shí)需要使用--enable-maintainer-zts
如果使用PHP5.3以上的版本,為了鏈接mysql數(shù)據(jù)庫,可以指定mysqlnd,
這樣在本機(jī)就不需要安裝mysql或者mysql開發(fā)包了,mysqlnd從php5.3開始可以使用,
可以編譯時(shí)綁定他(而不是和具體的mysql客戶端庫綁定形成依賴),
但從php5.4開始它就是默認(rèn)設(shè)備了
見招拆招:
configure: error: Cannot find OpenSSL's
安裝openssl-devel,bzip2-devel
如果php和mysql不在一臺(tái)服務(wù)器:
--with-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysqli=mysqlnd
4,配置
cp php.ini-production /etc/php.ini
vi /etc/httpd24/httpd.conf
檢查有沒有LoadModule php5_module modules/libphp5.so
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
后加兩行:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
修改一行,加 index.php
DirectoryIndex index.php index.html #次序很關(guān)鍵
重新載入httpd
rpm包安裝的話會(huì)在/etc/httpd/conf.d/下生成php.conf,編譯的話不會(huì)生成的,需要自己寫
5,驗(yàn)證
phpinfo();
?>
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
當(dāng)前文章:編譯安裝lamp-3(php)-創(chuàng)新互聯(lián)
當(dāng)前鏈接:http://ef60e0e.cn/article/dospgj.html