資源描述:
《redhat搭建php運(yùn)行環(huán)境lamp》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫。
1、REDHATENTERPRISELINUX搭建PHP運(yùn)行環(huán)境搭建一個論壇,以discuz為模板,RedHat為系統(tǒng),阿帕奇為web服務(wù)器,搭建PHP環(huán)境,后臺為MySQL數(shù)據(jù)庫,即時下流行的“LAMP”。Discuz_7.2_FULL_SC_UTF8mysql-5.0.22-2.1httpd-2.2.3-6.el5php-5.1.6-5.el51、PHP的運(yùn)行是在阿帕奇服務(wù)之上的,首先要安裝httpd服務(wù)[root@localhost~]#clear[root@localhost~]#rpm-qa
2、grephttpd[root
3、@localhost~]#mount/dev/cdrom/mnt/cdrom[root@localhost~]#yuminstall-yhttpd或者rpm-ivhapr-1.3.9-3.el6_1.2.i686.rpmrpm-ivhapr-util-1.3.9-3.el6_0.1.i686.rpmrpm-ivhapr-util-ldap-1.3.9-3.el6_0.1.i686.rpmrpm-ivhhttpd-tools-2.2.15-15.el6_2.1.i686.rpmrpm-ivhhttpd-2.2.15-15.el6
4、_2.1.i686.rpmrpm-ivhhttpd-manual-2.2.15-15.el6_2.1.noarch.rpm重啟httpd服務(wù),測試阿帕奇服務(wù)器:阿帕奇測試頁:1、安裝PHP解釋器:默認(rèn)安裝后,再次查詢會顯示以下組件:[root@localhost~]#rpm-qa
5、grepphpphp-common-5.1.6-5.el5php-5.1.6-5.el5php-cli-5.1.6-5.el5[root@localhost~]#還需要一個rpm包,來支持php與MySQL數(shù)據(jù)庫包名為php-mysql或者rpm-i
6、vhphp-common-5.3.3-3.el6_2.8.i686.rpmrpm-ivhphp-cli-5.3.3-3.el6_2.8.i686.rpmrpm-ivhphp-5.3.3-3.el6_2.8.i686.rpmrpm-ivhphp-pdo-5.3.3-3.el6_2.8.i686.rpmrpm-ivhphp-mysql-5.3.3-3.el6_2.8.i686.rpm編輯php配置文件:[root@localhost~]#vi/etc/httpd/conf.d/php.conf增加拓展名為.php文件的處理關(guān)系測試
7、PHP環(huán)境:在Apache主目錄/var/www/html中建立一個名為test.php文件文件內(nèi)容如下:重啟httpd服務(wù)測試:1、安裝MySQL數(shù)據(jù)庫,為安裝起見,并修改數(shù)據(jù)庫密碼為123[root@localhost~]#yuminstall–ymysql*[root@localhost~]#rpm–qa
8、grepmysql啟動MySQL數(shù)據(jù)庫:[root@localhost~]#servicemysqldstart初始化MySQL數(shù)據(jù)庫:Installingallprepare
9、dtablesFillhelptablesTostartmysqldatboottimeyouhavetocopysupport-files/mysql.servertotherightplaceforyoursystemPLEASEREMEMBERTOSETAPASSWORDFORTHEMySQLrootUSER!Todoso,starttheserver,thenissuethefollowingcommands:/usr/bin/mysqladmin-urootpassword'new-password'/usr/bin
10、/mysqladmin-uroot-hlocalhost.localdomainpassword'new-password'Seethemanualformoreinstructions.YoucanstarttheMySQLdaemonwith:cd/usr;/usr/bin/mysqld_safe&YoucantesttheMySQLdaemonwiththebenchmarksinthe'sql-bench'directory:cdsql-bench;perlrun-all-testsPleasereportanypro
11、blemswiththe/usr/bin/mysqlbugscript!ThelatestinformationaboutMySQLisavailableonthewebathttp://www.mysql.comSupportMySQLbybuyingsupport/lic