天天看點

linux下的PHP+Mysql+PHPWind實作

linux下的PHP+Mysql+PHPWind實作

1安裝httpd、mysql mysql-server php php-mysql php-mbstring

yum -y install mysql mysql-server

yum -y php php-mysql php-mbstring 

2.開啟httpd、Mysql 并為Mysql設定密碼

service httpd  start

service mysqld  start

mysqladmin -u root -p password '123456'

3.由于裝了php,是以會在/etc/httpd/conf.d/目錄裡多一個php.conf檔案

<a href="http://blog.51cto.com/attachment/201210/210927360.png" target="_blank"></a>

4.在/var/www/html/目錄裡建立index.php内容如下:

&lt;?php

phpinfo();

?&gt;

5.測試一下php和httpd及mysql的是否關聯

<a href="http://blog.51cto.com/attachment/201210/211053570.png" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201210/211106286.png" target="_blank"></a>

已關聯

為了友善mysql的管理,我們需要phpmyadmin的web方式的管理

軟體包為phpMyAdmin-2.11.10.1-all-languages.zip通過ftp上傳到問我們的伺服器,

解壓unzip phpMyAdmin-2.11.10.1-all-languages.zip

移動到/var/www/html/目錄裡并改名為phpmyadmin

mv phpMyAdmin-2.11.10.1-all-languages /var/www/html/phpmyadmin

<a href="http://blog.51cto.com/attachment/201210/211214400.png" target="_blank"></a>

客戶機通路

<a href="http://blog.51cto.com/attachment/201210/211231297.png" target="_blank"></a>

會發現有“錯誤”,但是能通路了,下面解決這個錯誤:

切換到/var/www/html/phpmyadmin/目錄裡

cp config.sample.inc.php config.inc.php

編輯vim config.inc.php

<a href="http://blog.51cto.com/attachment/201210/211404679.png" target="_blank"></a>

在“紅框裡”随意寫一些内容,開啟cookie

再次客戶機通路(記得之前要重新開機httpd)

<a href="http://blog.51cto.com/attachment/201210/211430502.png" target="_blank"></a>

沒有錯誤了,輸入使用者名和密碼就可以進入了

<a href="http://blog.51cto.com/attachment/201210/211513523.png" target="_blank"></a>

但是你還會發現有一個感歎号即“無法載入scrypt擴充”,解決方法是安裝該擴充即

(libmcrypt-2.5.7-5.el5.i386.rpm、php-mcrypt-5.1.6-5.el5.i386.rpm)通過ftp上傳到伺服器

Yum  -y  localinstall libmcrypt-2.5.7-5.el5.i386.rpm

php-mcrypt-5.1.6-5.el5.i386.rpm  --nogpgcheck

重新開機httpd後,再次客戶機通路

<a href="http://blog.51cto.com/attachment/201210/211618752.png" target="_blank"></a>

一切正常

下面實作phpwind論壇

論壇包為phpwind_GBK_8.3.zip通過ftp上傳到伺服器

解壓unzip phpwind_GBK_8.3.zip

切換到phpwind_GBK_8.3目錄裡

cd phpwind_GBK_8.3

<a href="http://blog.51cto.com/attachment/201210/211648560.png" target="_blank"></a>

将upload還轉移到/var/www/html/并重命名為phpwind

mv uploa /var/www/html/phpwind

<a href="http://blog.51cto.com/attachment/201210/211701251.png" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201210/211715109.png" target="_blank"></a>

會看到什麼也沒,這是編碼造成的,在浏覽器中選擇如下圖:

<a href="http://blog.51cto.com/attachment/201210/211829811.png" target="_blank"></a>

選擇“簡體中文”

<a href="http://blog.51cto.com/attachment/201210/211942709.png" target="_blank"></a>

看到了,但是每次都這樣改有點麻煩,我們可以修改

/etc/httpd/conf/httpd.conf檔案來實作 第746行改為GB2312

<a href="http://blog.51cto.com/attachment/201210/212003589.png" target="_blank"></a>

重新開機httpd就可以了

論壇的安裝

<a href="http://blog.51cto.com/attachment/201210/212016757.png" target="_blank"></a>

按要求更改“紅框裡“的目錄權限為777

<a href="http://blog.51cto.com/attachment/201210/212056476.png" target="_blank"></a>

單擊“開始安裝”》“同意協定,下一步”》

<a href="http://blog.51cto.com/attachment/201210/212108454.png" target="_blank"></a>

單擊下一步》下一步

<a href="http://blog.51cto.com/attachment/201210/212127311.png" target="_blank"></a>

單擊“關閉”并在伺服器端删除install.php檔案

<a href="http://blog.51cto.com/attachment/201210/212139957.png" target="_blank"></a>

再次進入就是論壇首頁面了如下:

<a href="http://blog.51cto.com/attachment/201210/212156820.png" target="_blank"></a>

事實上phpwind目錄即論壇網站可以不在/var/www/html/下,可以放在任何位置,通過虛拟目錄來實作。。。

實驗完畢。。。

本文轉自 abc16810 51CTO部落格,原文連結:http://blog.51cto.com/abc16810/1034856