您好,登錄后才能下訂單哦!
php、mysql基礎(chǔ)
需先安裝httpd服務(wù),使得web服務(wù)器啟用。
一、安裝PHP
[root@johntest ~]# ls #先下載rpm安裝包
php53-5.3.3-23.el5_10.x86_64.rpm sys dead.letter inittab.des3
php53-cli-5.3.3-23.el5_10.x86_64.rpm sysroo1.gz install.log.syslog
php53-common-5.3.3-23.el5_10.x86_64.rpm dev php53-mbstring-5.3.3-23.el5_10.x86_64.rpm
dropbear-2013.56 ks.cfg php53-mysql-5.3.3-23.el5_10.x86_64.rpm
dropbear-2013.56.tar.bz2 lib php53-pdo-5.3.3-23.el5_10.x86_64.rpm
[root@johntest ~]# rpm -ivh php53-common-5.3.3-23.el5_10.x86_64.rpm
warning: php53-common-5.3.3-23.el5_10.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php53-common ########################################### [100%]
[root@johntest ~]# rpm -ivh php53-cli-5.3.3-23.el5_10.x86_64.rpm
warning: php53-cli-5.3.3-23.el5_10.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php53-cli ########################################### [100%]
[root@johntest ~]# rpm -ivh php53-mbstring-5.3.3-23.el5_10.x86_64.rpm
warning: php53-mbstring-5.3.3-23.el5_10.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php53-mbstring ########################################### [100%]
[root@johntest ~]# rpm -ivh php53-5.3.3-23.el5_10.x86_64.rpm
warning: php53-5.3.3-23.el5_10.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php53 ########################################### [100%]
[root@johntest ~]# rpm -ivh php53-mysql-5.3.3-23.el5_10.x86_64.rpm
warning: php53-mysql-5.3.3-23.el5_10.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
php53-pdo is needed by php53-mysql-5.3.3-23.el5_10.x86_64 #提示依賴php53-pdo
[root@johntest ~]# rpm -ivh php53-pdo-5.3.3-23.el5_10.x86_64.rpm
warning: php53-pdo-5.3.3-23.el5_10.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php53-pdo ########################################### [100%]
[root@johntest ~]# rpm -ivh php53-mysql-5.3.3-23.el5_10.x86_64.rpm
warning: php53-mysql-5.3.3-23.el5_10.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php53-mysql ########################################### [100%]
[root@johntest ~]# cd /var/www/a.com/
[root@johntest a.com]# vim index.php #內(nèi)容修改為以下
<title>a.com</title>
<h2>test a.com</h2>
<?php
$conn=mysql_connect('localhost','root','123456');
if ($conn)
echo "Success...";
else
echo "Failure...";
?>
[root@johntest a.com]# service httpd restart #重啟httpd服務(wù)
停止 httpd: [確定]
啟動(dòng) httpd: [確定]
[root@johntest a.com]# service mysqld restart #重啟mysqld服務(wù)
停止 MySQL: [確定]
啟動(dòng) MySQL: [確定]
通過(guò)網(wǎng)頁(yè)訪問(wèn)如下:
1、使用phpMyAdmin提供管理mysql界面部署網(wǎng)站:
首先下載phpMyAdmin:
[root@johntest ~]# ls
dropbear-2013.56.tar.bz2 php53-pdo-5.3.3-23.el5_10.x86_64.rpm
etc phpMyAdmin-3.4.9-all-languages.zip
[root@johntest ~]# mv phpMyAdmin-3.4.9-all-languages /var/www/a.com/
[root@johntest ~]# cd /var/www/a.com/
[root@johntest a.com]# ls
index.php phpMyAdmin-3.4.9-all-languages
[root@johntest a.com]# mv phpMyAdmin-3.4.9-all-languages pma
[root@johntest a.com]# ls
index.php pma
在客戶端通過(guò)以下網(wǎng)址即可登錄php管理數(shù)據(jù)庫(kù)界面:www.a.com/pma
2、通過(guò)discuz部署論壇網(wǎng)頁(yè):
首先下載discuz x2.5版本:http://www.discuz.net/thread-2744369-1-1.html
[root@johntest ~]# ls
......
Discuz_X2.5_SC_UTF8.zip php53-mysql-5.3.3-23.el5_10.x86_64.rpm
......
[root@johntest ~]# unzip Discuz_X2.5_SC_UTF8.zip #解壓該壓縮包
[root@johntest ~]# rm -rf /var/www/b.com/* #先把b.com中的內(nèi)容清空
[root@johntest ~]# mv upload/* /var/www/b.com/ 把剛才解壓出來(lái)的upload文目錄中的文件都移 至需要配置部署的網(wǎng)址目錄中/var/www/b.com
[root@johntest ~]# ls /var/www/b.com/
admin.php config data home.php member.php robots.txt template
api connect.php favicon.ico misc.php search.php uc_client
api.php cp.php forum.php index.php plugin.php source uc_server
archiver crossdomain.xml group.php install portal.php static userapp.php
在客戶端網(wǎng)頁(yè)中輸入:www.b.com
如果打開網(wǎng)站提示亂碼,是下載的discuz語(yǔ)言不一致導(dǎo)致,需注釋掉/etc/httpd/conf/httpd.conf主配置文件中的#AddDefaultCharset UTF-8 這行內(nèi)容。
把上圖紅色框內(nèi)的文件和目錄的權(quán)限都修改為777:
[root@johntest b.com]# chmod 777 ./config/config_global_default.php
[root@johntest b.com]# chmod 777 ./config/config_ucenter_default.php
[root@johntest b.com]# chmod 777 ./config
[root@johntest b.com]# chmod 777 ./data
[root@johntest b.com]# chmod 777 ./data/cache
[root@johntest b.com]# chmod 777 ./data/avatar
[root@johntest b.com]# chmod 777 ./data/plugindata
[root@johntest b.com]# chmod 777 ./data/download
[root@johntest b.com]# chmod 777 ./data/addonmd5
[root@johntest b.com]# chmod 777 ./data/template
[root@johntest b.com]# chmod 777 ./data/threadcache
[root@johntest b.com]# chmod 777 ./data/p_w_upload
[root@johntest b.com]# chmod 777 ./data/p_w_upload/album
[root@johntest b.com]# chmod 777 ./data/p_w_upload/forum
[root@johntest b.com]# chmod 777 ./data/p_w_upload/group
[root@johntest b.com]# chmod 777 ./data/log
[root@johntest b.com]# chmod 777 ./uc_
uc_client/ uc_server/
[root@johntest b.com]# chmod 777 ./uc_client/data/cache
[root@johntest b.com]# chmod 777 ./uc_server/data/
[root@johntest b.com]# chmod 777 ./uc_server/data/{cache,avatar,backup,logs,tmp,view}
修改完成后,刷新網(wǎng)站,如下:
[root@johntest b.com]# cd install
[root@johntest install]# ls
data p_w_picpaths include index.php
[root@johntest install]# mv index.php index.php.bak
至此一個(gè)論壇模板的網(wǎng)站已經(jīng)建立,并可以進(jìn)行后臺(tái)管理。
3、通過(guò)workpress部署博客網(wǎng)頁(yè):
首先下載workpress4.7.2版本:https://cn.wordpress.org/
[root@johntest ~]# ls
wordpress-4.7.2-zh_CN.zip
[root@johntest ~]# unzip wordpress-4.7.2-zh_CN.zip
[root@johntest ~]# cd wordpress
[root@johntest wordpress]# ls
index.php wp-admin wp-content wp-load.php wp-signup.php
license.txt wp-blog-header.php wp-cron.php wp-login.php wp-trackback.php
readme.html wp-comments-post.php wp-includes wp-mail.php xmlrpc.php
wp-activate.php wp-config-sample.php wp-links-opml.php wp-settings.php
[root@johntest wordpress]# ls /var/www/weblinux.com/
index.html
[root@johntest wordpress]# rm /var/www/weblinux.com/* -rf
[root@johntest wordpress]# ls /var/www/weblinux.com/
[root@johntest wordpress]# cd /var/www/weblinux.com/
[root@johntest weblinux.com]# ls
index.php wp-admin wp-content wp-load.php wp-signup.php
license.txt wp-blog-header.php wp-cron.php wp-login.php
wp-trackback.php readme.html wp-comments-post.php wp-includes wp-mail.php xmlrpc.phpwp-activate.php wp-config-sample.php wp-links-opml.php wp-settings.php
在客戶端網(wǎng)頁(yè)中輸入:www.weblinux.com
可能在配置過(guò)程中會(huì)出現(xiàn)點(diǎn)小錯(cuò)誤,按照錯(cuò)誤提示設(shè)置即可。 至此wordpress博客網(wǎng)頁(yè)就建立成功。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。