1. 程式人生 > >yum,httpd,php環境搭建方法

yum,httpd,php環境搭建方法

lpn bin kcon devel php-mysql common secure httpd 環境

#刪除已有的yum

1 rpm -qa|grep yum|xargs rpm -e --nodeps

2 ls

3 rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

4 rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

5 rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

6 cd /etc/yum.repos.d/

7 ls

8 mv /root/CentOS-Base.txt ./CentOS-Base.repo

9 ls

10 yum clean all

11 yum makecache

12 cd

#httpd安裝啟動

13 yum -y install httpd

#加入

14 chkconfig httpd on

15 service httpd start

# 這條命令能卸載幹凈mysql 然後重裝(備用)

#yum remove mysql mysql-server mysql-libs compat-mysql51

16 yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql

17 yum -y install mysql mysql-server mysql-devel

18 chkconfig mysqld on

19 service mysqld start

20 /usr/bin/mysqladmin -u root password ‘123456‘

21 mysql -u root -p

22 /usr/bin/mysql_secure_installation

23 mysql -u root -p

24 netstat -tulpn | grep -i mysql

#增加80端口命令

# vim /etc/sysconfig/iptables

#

#php流程

25 yum -y install php php-mysql

26 yum search php

27 yum -y install gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap

28 service httpd restart

29 vim /var/www/html/index.php

#這句話加入其中

<?php

phpinfo();

?>

~

#保存退出

30 cd /var/www/html/

#這兩步根據具體文件進行操作,因為文件名有可能不一樣

31 cp /root/ecmoban_V2.7.3_UTF8_20160825\ \(2\).zip ./

32 unzip ecmoban_V2.7.3_UTF8_20160825\ \(2\).zip

#文件名有可能不一樣

33 ls

34 cd ecmoban_V2.7.3_UTF8_20160

35 ls

36 cd ecmoban_V2.7.3_UTF8_20160722/

37 ls

38 cd ecmoban_V2.7.3_UTF8_20160720/

39 ls

40 cd ../

41 ls

42 mv ecmoban_V2.7.3_UTF8_20160720/ ../ecmoban27

43 vim /var/www/html/ecmoban27/upload/includes/cls_mysql.php

#因為頁面報版本提示錯誤所以要註釋掉提示錯誤的163行的#命令:set nu 顯示航行 命令:163 查找163行

if ($this->platform == ‘OTHER‘ &&

162 ($dbhost != ‘.‘ && strtolower($dbhost) != ‘localhost:3306‘ && $dbhost != ‘127.0.0.1:3306‘) /*||

163 (PHP_VERSION >= ‘5.1‘ && date_default_timezone_get() == ‘UTC‘)*/)

#

yum,httpd,php環境搭建方法