2011年1月17日 星期一

centos5.5升級php5.2

==============安裝php5==========

http://joomlab15.exonsoft.com/zh-tw/articles/general/83-upgrade-php-to-52x-on-centos

要使用 CentOS-Testing 軟體套件庫,必須先把它加入到 YUM 的軟體套件庫設置內。只要用文字編輯器開啟 /etc/yum.repos.d/CentOS-Base.repo 檔案,在將下面的內容加到檔案最後:
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to function properly.
# These packages build and install, but are waiting for feedback from testers as to
# functionality and stability. Packages in this repository will come and go during the
# development period, so it should not be left enabled or used on production systems without due
# consideration.

請不要在設置裡把這個軟體套件庫啟用。當你想從該軟體套件庫取得軟體包時,在指令內啟用即可。現在讓我們先檢查看看這個軟體套件庫裡有什麼與 PHP 有關的升級包。在你的指令殼(command shell)下鍵入已下的指令:
yum --disablerepo=* --enablerepo=c5-testing check-update php*

指令內的選項告訴 YUM 把所有的軟體套件庫都停用,只使用 c5-testing,並且檢查任何名字是以 php 開頭的升級包。你會看見一份與 PHP 有關的套件包列表,上面的套件包都是可以用來升級你的 PHP 安裝。
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile

php.i386 5.2.9-2.el5.centos c5-testing
php-cli.i386 5.2.9-2.el5.centos c5-testing
php-common.i386 5.2.9-2.el5.centos c5-testing
php-gd.i386 5.2.9-2.el5.centos c5-testing
php-imap.i386 5.2.9-2.el5.centos c5-testing
php-mbstring.i386 5.2.9-2.el5.centos c5-testing
php-mcrypt.i386 5.2.9-2.el5.centos.3 c5-testing
php-mysql.i386 5.2.9-2.el5.centos c5-testing
php-pdo.i386 5.2.9-2.el5.centos c5-testing

很快地檢視這份列表。如果那些套件包看起來合理,你就可以進行安裝。你必須再次停用其他的軟體套件庫。
yum --disablerepo=* --enablerepo=c5-testing update php*

遵照螢幕上的指示,你很快就會有 PHP 5.2.x 安裝在你的 CentOS 伺服器上了。

=======安裝mysql=========
yum --disablerepo=* --enablerepo=c5-testing update mysql;*

出現錯誤code
mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhos
http://ca95.pixnet.net/blog/post/6841076

[root@localhost ~]# mysqladmin -u root passwd '新密碼'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

[root@localhost ~]# service mysqld stop
[root@localhost ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[root@localhost ~]# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('新密碼') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

[root@localhost ~]# service mysqld start
[root@localhost ~]# mysql -uroot -p
Enter password: 新密碼



==================phpmyadmin=======================
http://blog.xuite.net/dragonbesta/dragonbesta/30771056
http://www.pczone.com.tw/vbb3/archive/t-103939.html



1.yum install mbstring


名稱hpmyadin
說明:先到phpmyadin,看到建立新資料庫,空白框鍵入phpmyadin

2.找到create_tables.sql
說明:檔案位址在phpmyadin目錄中的scripts文件夾,就看到
create_tables.sql檔案了

3.create_tables.sql檔copy到mysql目錄中的bin文件夾

4.用cmd模式進入bin目錄中
說明:C:\Documents and Settings\Administrator>cd\
C:\cd mysql\bin
C:\mysql\bin>

5.匯入create_tables.sql檔到phpmyadin資料庫中
說明:上面第四步驟,鍵入
C:\mysql\bin>mysql -uroot -p資料庫密碼 phpmyadin
6.更改config.inc.php
說明:檔案在phpmyadin目錄下,以下為更改數據

$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // Database used for Relation, Bookmark and PDF Features
// (see scripts/create_tables.sql)
// - leave blank for no support
// DEFAULT: 'phpmyadmin'
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; // Bookmark table
// - leave blank for no bookmark support
// DEFAULT: 'pma_bookmark'
$cfg['Servers'][$i]['relation'] = 'pma_relation'; // table to describe the relation between links (see doc)
// - leave blank for no relation-links support
// DEFAULT: 'pma_relation'
$cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // table to describe the display fields
// - leave blank for no display fields support
// DEFAULT: 'pma_table_info'
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // table to describe the tables position for the PDF schema
// - leave blank for no PDF schema support
// DEFAULT: 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // table to describe pages of relationpdf
// - leave blank if you don't want to use this
// DEFAULT: 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // table to store column information
// - leave blank for no column comments/mime types
// DEFAULT: 'pma_column_info'
$cfg['Servers'][$i]['history'] = 'pma_history'; // table to store SQL history
// - leave blank for no SQL query history
// DEFAULT: 'pma_history'

沒有留言:

張貼留言