欢迎来到天天文库
浏览记录
ID:26706992
大小:426.15 KB
页数:12页
时间:2018-11-28
《redhat搭建php运行环境lamp》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、REDHATENTERPRISELINUX搭建PHP运行环境搭建一个论坛,以discuz为模板,RedHat为系统,阿帕奇为web服务器,搭建PHP环境,后台为MySQL数据库,即时下流行的“LAMP”。Discuz_7.2_FULL_SC_UTF8mysql-5.0.22-2.1httpd-2.2.3-6.el5php-5.1.6-5.el51、PHP的运行是在阿帕奇服务之上的,首先要安装httpd服务[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服务,测试阿帕奇服务器:阿帕奇测试页:1、安装PHP解释器:默认安装后,再次查询会显示以下组件:[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数据库包名为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文件的处理关系测试
7、PHP环境:在Apache主目录/var/www/html中建立一个名为test.php文件文件内容如下:重启httpd服务测试:1、安装MySQL数据库,为安装起见,并修改数据库密码为123[root@localhost~]#yuminstall–ymysql*[root@localhost~]#rpm–qa
8、grepmysql启动MySQL数据库:[root@localhost~]#servicemysqldstart初始化MySQL数据库: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
此文档下载收益归作者所有