[iyunv@localhost /]yum -y install php php-mysql httpd mariadb-server [iyunv@localhost /]vim /var/www/html/index.php
<?php
phpinfo();
?> [iyunv@localhost /]systelctl restart httpd ;systemctl enabled httpd ;Systelctl restart mariadb-server ;systemctl enabled mariadb-server Firefox 访问localhost [iyunv@localhost /]mysql MariaDB [(none)]> GRANT ALL ON testdb.* TO testuser@'%' IDENTIFIED BY 'testpass';
Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit
Bye
[iyunv@localhost /]# mysql -u testuser -h 主机地址 -p Enter password:testpass
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>exit Bye
[iyunv@localhost /]vim /var/www/html/index.php <?php $conn = mysql_connect(“主机地址”,”testuser”,”testpass”); if ($conn) echo “OK”; else echo “NO”; ?>
上传wordpress-3.3.1-zh_CN.zip到根目录()
[iyunv@localhost /]unzip wordpress-3.3.1-zh_CN.zip [iyunv@localhost /]# ls bin etc lib64 opt run sys var boot home media proc sbin tmp wordpress dev lib mnt root srv usr wordpress-3.3.1-zh_CN.zip [iyunv@localhost /]# mv wordpress /var/www/html/ [iyunv@localhost /]# cd /var/www/html/ [iyunv@localhost html]# cd wordpress/ [iyunv@localhost wordpress]# ls index.php wp-config-sample.php wp-pass.php license.txt wp-content wp-register.php readme.html wp-cron.php wp-settings.php wp-activate.php wp-includes wp-signup.php wp-admin wp-links-opml.php wp-trackback.php wp-app.php wp-load.php xmlrpc.php wp-blog-header.php wp-login.php wp-comments-post.php wp-mail.php [iyunv@localhost wordpress]# cp wp-config-sample.php wp-config-sample.php.back [iyunv@localhost wordpress]# mv wp-config-sample.php wp-config.php [iyunv@localhost wordpress]# ls index.php wp-config.php wp-mail.php license.txt wp-config-sample.php.back wp-pass.php readme.html wp-content wp-register.php wp-activate.php wp-cron.php wp-settings.php wp-admin wp-includes wp-signup.php wp-app.php wp-links-opml.php wp-trackback.php wp-blog-header.php wp-load.php xmlrpc.php wp-comments-post.php wp-login.php [iyunv@localhost wordpress]# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> GRANT ALL ON wpdb.* TO wpuser@'%' IDENTIFIED BY 'wppass'; Query OK, 0 rows affected (0.02 sec) MariaDB [(none)]> create database wpdb; Query OK, 1 row affected (0.02 sec) MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit Bye [iyunv@localhost wordpress]# vim wp-config.php // ** MySQL 设置 - 具体信息来自您正在使用的主机 ** // /** WordPress 数据库的名称 */ define('DB_NAME', 'pwdb'); /** MySQL 数据库用户名 */ define('DB_USER', 'pwuser'); /** MySQL 数据库密码 */ define('DB_PASSWORD', 'pwpass'); /** MySQL 主机 */ define('DB_HOST', '主机地址');
火狐访问主机:localhost/wordpress,按需求安装wordpress
|