4.安装apache扩展:
#yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
5.安装php扩展:
yum install php53-cli php53-common php53-devel php53-gd php53-mbstring php53-soap php53-xml php53-xmlrpc php53-bcmath php53-snmp php-mysqli
6. Install the mysql extension:
#yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
7. Configure the startup service
#chkconfig httpd on [set the apache service startup]
#chkconfig mysqld on [set the mysql service startup Start]
#service httpd restart [start httpd service]
#service mysqld restart [start mysqld service]
8. Install the zipunzip command.
For the convenience and speed of uploading the source code, the compressed package is usually uploaded, so after installing zipunzip, you can unzip it online;
yum install zip unzip
9. Modify the database password: www.111cn.net When the
initial password is empty: mysqladmin -uroot pass word new password
The initial password is not empty: mysqladmin -uroot -p old password password new password
10. It is set to allow the root user to log in remotely from anywhere, and to have any operation permissions for all libraries. By default, root medical care can only access the database
locally . I do this setting for the convenience of managing the database. The specific operations are as follows: first log in to mysql using the root user on this machine:
mysql -u root -p "youpassword"
to authorize operations:
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
reload authorization table:
FLUSH PRIVILEGES;
Apache configuration
-
Go to Apache's conf directory
-
Open the httpd.conf file and enter:
2.1: Find #Virtual hosts
2.2: Enter:
<VirtualHost *:80>
DocumentRoot F:/www_php/blog_com/my_blog#Corresponding to the domain name - project directory
ServerName blog.com#corresponding to the project directory - domain name
</VirtualHost>
-
Another way:
3.1: Find #Virtual hosts
3.2:
Remove the "#" in front of # Include conf/extra/httpd-vhosts.conf
3.3:
Open the Apache2.2\conf\extra\httpd-vhosts.conf file in the Apache directory
3.4: Add at the end of the file
<VirtualHost *:80>
DocumentRoot F:/www_php/blog_com/my_blog#Corresponding to the domain name - project directory
ServerName blog.com#corresponding to the project directory - domain name
</VirtualHost>
-
restart Apache
The PHP code document is placed under /var/www/html/ and it can be used.