免再比啦,免費專業諮詢,提供土地登記 銀行房貸信貸、不動產稅法等服務,歡迎諮詢! | 提供經驗豐富搬家,專業服務團隊 動作準時快速,服務貼心,線上免費估價再送紙箱 |
[教學]重新安裝php |
房東:詹先生 發表時間:2014-11-12 |
由於之前系統為了測試新東西、所以安裝了許多php5.3的套件 不過php5.3後不支援舊的php程式實在太多了、加上之前的php設定錯誤 造成今天重新啟動apache的時候產生大當機 最後解決的辦法主要是參考這篇文章 移除remi的php安裝到5.2較穩定的版本 php與mysql降級過程記錄: 1.移除php-->yum remove php 2.移除mysql-->yum remove mysql ps.我移除前有先備份,但事實上証明、並不需要 3.移除被remi更新的相關套件-->yum remove *remi 5.檢查有無之前更新的remi安裝的套件(rpm -qa|grep remi),若有記得利用(yum remove *remi)移除,或是用(rpm -e)手動移除。 4.移除epel與remi: yum remove epel-release-5-3 --> 會將相關套件 remi-release-5-7 一起移除。 5.利用yum install 裝回php與mysql yum install php yum install mysql 6.檢查設定檔與相關的套件 7.重新啟動Apache與mysql 升級法二: 1.從官網(http://dev.centos.org/centos/5/)下載CentOS-Testing.repo檔案(http://dev.centos.org/centos/5/CentOS-Testing.repo)至/etc/yum.repos.d/目錄下 2.CentOS-Testing.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. ########################################## 將CentOS-Testing.repo檔案內的enabled=0 改成 enabled=1啟動這個repo 3. ※先備份php.ini、httpd.conf、my.cnf ※yum install php-->php5.1.6升級至php5.2.10 ※yum update httpd也有更新(從2.2.3-->2.2.8)結果httpd.conf設定檔恢復成預設值 --> 將備份檔覆蓋httpd.conf,然後restart httpd |
|
油漆粉刷工程 優質油漆師傅,專業的油漆工程,免費諮詢刷油漆大小事,值得您信賴! DRAPERY窗簾設計 捲簾、窗簾布、窗簾布多種款式,免費丈量,挑戰市場超低價,為家輕鬆增添新意 TECHNIQUE冷氣空調規劃 冷氣界的達人,多重售後服務保障,專業熱忱技術,多戶家庭一致推薦 |
1 樓住戶:jack 發表時間:2014-11-12 |
升級版本 CentOS yum 只有php5.1.6 但工作需要因此在網路上找方法讓php 5.2.1 升級到5.3.8 參考 http://www.webtatic.com/packages/php53/ http://blog.smps.tp.edu.tw/~kcodavid/index.php?load=read&id=564 首先 1.rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm 2. 安裝 yum --enablerepo=webtatic install php 升級 yum --enablerepo=webtatic update php 但php5.3.8 有許多安全性的修改使得先前的函式會產生安全性警告 因此,可以升級到5.2.17 yum --disablerepo=* --enablerepo=webtatic --exclude=php*5.3* update php 降級版本 若已經安裝到5.3.8造成網站產生許多警告訊息,可以利用降級的方法恢復 1. 先移除php 包含php套件等 yum remove php* 2. yum --disablerepo=* --enablerepo=webtatic --exclude=php*5.3* install php (將會安裝5.2.17) 3.安裝 php套件 yum --disablerepo=* --enablerepo=webtatic --exclude=php*5.3* install php-mbstring 如安裝 php-mcrypt , php-devel , php-gd , php-mysql 等 可參考 http://www.webtatic.com/packages/php53/ |
2 樓住戶:jack 發表時間:2014-11-12 |
PHP 5.3 降為 5.2 yum install libXpm.so.4 libt1.so.5 autoconf automake gd rpm -ivh php-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-cli-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-common-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-devel-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-gd-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-ldap-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-mbstring-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-mysql-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-pdo-5.2.17-1.el6.art.x86_64.rpm rpm -ivh php-xml-5.2.17-1.el6.art.x86_64.rpm rpm -ivh t1lib-5.1.2-6.el6_2.1.x86_64.rpm ; 避免 yum 更新到 php 做以下設定 vi /etc/yum.conf 加入 exclude=php* |
3 樓住戶:jack 發表時間:2014-11-12 |
在 centos6 將 PHP 5.3 降版至 5.2 1. 安裝 atomic repository wget -q -O - http://www.atomicorp.com/installers/atomic | sh 安裝完畢會看到 /etc/yum.repos.d/atomic.repo 2. 移除 php5.3 (如無安裝過即跳過此步驟) yum remove php* 3. 安裝 php 5.2 php-5.2* php-mbstring-5.2* php-xml-5.2* php-ldap-5.2* php-gd-5.2* php-xml-5.2* php-pdo-5.2* 4.避免升級到 php 5.3 vi /etc/yum.repos.d/atomic.repo 或 /etc/yum.conf 加入 exclude=php-5.3* (加在 [atomic] 內) |
4 樓住戶:jack 發表時間:2014-11-12 |
I recommend you to install PHP 5.2 through source. Before you proceed first make sure you have the right packages installed to compile from source. Probably the easiest way to do it as following: # stop apache /etc/init.d/httpd stop # remove PHP 5.3 RPM yum remove php # install packages to compile from source yum groupinstall "Development Tools" yum install httpd-devel yum install libxml2-devel yum install mysql-devel # download PHP 5.2.13 Source from www.php.net # after that extract the tar file: tar -zxvf php-5.2.13.tar.gz cd php-5.2.13 ./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/local make make test (not neccessary) make install # hopefully the compilation is succesfully completed # now copy the default php.ini cp php.ini-recommended /usr/local/lib/php.ini # edit php ini vi /usr/local/lib/php.ini # change this: short_open_tag = Off # to: short_open_tag = On # save the document # edit your Apache http.conf to allow .php files to be parsed vi /etc/httpd/conf/httpd.conf # add the following lines: LoadModule php5_module modules/libphp5.so SetHandler application/x-httpd-php # save the document # restart apache /etc/init.d/httpd restart Enjoy PHP 5.2.X! |
5 樓住戶:陳經理 發表時間:2014-11-12 |
Apologies, I eventually found a similar thread on the forum.
|
6 樓住戶:jack 發表時間:2014-11-17 |
Gallery2.31 相簿安裝 影音轉換 PHP 5.3 on CentOS 5 Webtatic.com RPM Search RedHat EL 5 php-eaccelerator-0.9.6.1-2.el5.remi.x86_64.rpm 兩個我常用的 CentOS Yum Repo 一. remi 與 epel升級倉庫—> PHP MYSQL 等 rpm -Uvh http://mirror01.idc.hinet.net/EPEL/5/x86_64/epel-release-5-4.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/5/remi/x86_64/remi-release-5-8.el5.remi.noarch.rpm 導入認證KEY rpm –import http://rpms.famillecollet.com/RPM-GPG-KEY-remi移除 mysql i386 /etc/init.d/mysqld stop yum erase mysql.i386 安裝升級php 與 mysql yum –enablerepo=remi check-update yum –enablerepo=remi upgrade php mysql mysql-server php-mysql php-devel php-gd php-mcrypt php-mstring /etc/init.d/mysqld start 設定密碼:mysqladmin -u root password ‘密碼’ 如 mysql ,升級或安裝時,套件清單 都會出現相同名稱的兩套套件,差別只在 i386 與 x86_64 的差異, 若不管,直接輸入 y 安裝之後,一旦要啟動 mysql ,系統就會警告說有兩套 mysql 在系統中,無法啟動!這問題我在安裝 perl 的時候就發生過,結果 perl 就無法執行! 也許可以 rpm -qa grep mysql 確認一下系統上還有哪些 mysql 套件,是否不只是因為有同一版本的 i386 與 x64 或用 yum list mysql* 確認一下有哪些 mysql 套件 只需要在 yum.conf 加上一行過濾掉 i386, i686 的軟件包就可以了: # vi /etc/yum.conf [main] … exclude=*.i386 *.i686 二. rpmforge 升級倉庫 (另一個類似atrpms repository)—影音類如果是選擇以RPM先連上軟件倉庫最容易更新相關影音轉碼套件 ,CentOS 5.4默認的Repository裡找不到這些yum包,先安裝rpmforge這個Repository。很全很強大,近10000個軟件包。 #32位:wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm #64位:wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm #rpm -Uvh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm 導入認證KEY rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt (若為CentOS6.xx 則 32位: http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm ) #yum –enablerepo=rpmforge check-update 修改 vi /etc/yum.repos.d/rpmforge.repo enabled = 1 ==> enabled = 0 然後參照 Install ffmpeg, flvtool2, mplayer, mencoder and ffmpeg-php in Cpanel/CentOS或安裝 Gallery2 電子相簿系統 需額外下載 Transcode Module 放到gallery2 module 目錄 以下方式一次安裝(除了ffmapeg 比較麻煩) yum install –enablerepo=rpmforge ImageMagick netpbm netpbm-progs jhead ffmpeg ffmpeg-devel flvtool2 mplayer mencoder lame libogg libvorbis libtheora swftools amrnb amrwb transcode x264 How To Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on CentOS 5.x Sohail Riaz, Linux and Open Source Blog 參考下列方式可以自行安裝較新套件奇想空 先教Server學轉片吧 Install ffmpeg, flvtool2, mplayer, mencoder and ffmpeg-php in Cpanel/CentOS L i j e e s h . I N 1. Open the file “/ffmpeg-php-0.6.0/ffmpeg_frame.c” 2. Replace all PIX_FMT_RGBA32 with PIX_FMT_RGB32 (vi:n1,n2s/PIX_FMT_RGBA32/PIX_FMT_RGB32)/g Install ffmpeg ffmpeg-php and Audio Binaries on CentOS / RHEL System with Cpanel (1)LAME (Lame Aint an MP3 Encoder) (2)ffmpeg ffmpeg-php extension ffmpeg-php (3)FLVTool2 ImageMagick: Install from Binary Distribution http://registerboy.pixnet.net/blog/post/24896148 Installing or Upgrading PHP 5.3.2 cd /root rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm yum –enablerepo=webtatic install php yum –enablerepo=webtatic install php-devel yum-allowdowngrade 可以降级的插件: allow downgrade for yum: yum install yum-allowdowngrade Add a line to yum.conf: showdupesfromrepos=1 After that list all php packages: yum list php If php 5.2.8 is available, remove new one: yum remove php and install an old one: yum –allow-downgrade install php-5.2.8 相關套件說明可參考這邊Install ffmpeg ffmpeg-php and Audio Binaries on CentOS / RHEL System with Cpanel 在php.ini裡有一些跟上傳檔案時有關的數值, ◦upload_max_filesize: 這是上傳單一檔案的大小限制,譬如我若允許上傳超過20MB的影片檔,那這數值就必須至少大於「20M」才可以。 ◦post_max_size: PHP允許一次上傳檔案的大小限制,譬如Gallery2要上傳檔案時,可以一次多個檔案上傳,若我一次要上傳2個15MB的影片檔,那麼這個數值就必須至少大於「30M」了。 這個 post_max_size 必須大於 upload_max_filesize ◦memory_limit: 執行每個scripts時使用的memory大小限制 這個 memory_limit 必須大於 post_max_size 這三個數值的大小,必須是 memory_limit > post_max_size > upload_max_filesize 布丁布丁吃什麼?: VNCserver初始設定與自動啟動 MYSQL 先將mysql的服務啟動 #chkconfig mysqld on #service mysqld start 以下範例為將預設的空密碼改為"my1234〃 #mysqladmin -u root password my1234 如果你是要將舊密碼改為"my1234〃 #mysqladmin -u root -p password my1234 Enter password: <==這裡請輸入舊的密碼 phpMyAdmin 先到phpmyadmin的目錄裡面 #cd /var/www/html/phpMyAdmin 產生config.inc.php設定檔 預設是沒有這個檔案的,要先將config.sample.inc.php複製成config.inc.php #cp ./config.sample.inc.php ./config.inc.php 將認證方式改為http或是cookie還有修改hostname 為方便MySQL的DB操作(或許以經習慣使用phpMyAdmin來設定DB). 安裝時會有一些要處理的事項, 在此記錄. PS: 此文大多搜集網路 1. 於phpMyAdmin網頁下載最新版本. 2. /etc/httpd/conf.d/, 新增phpmyadmin.conf Alias /phpMyAdmin /var/www/phpMyAdmin Order deny, allow Deny From ALL Allow From 192.168.0. 開啟 myphpadmin下的config.sample.inc.php 3.將 $cfg['Servers'][$i]['auth_type'] = ‘cookie’; cookie改為 http,另存為 config.inc.php 4.重新啟動apache service httpd restart ———————————————————————- I. 問題1 http://xxx/phpMyAdmin頁面出現 1 php 5.2+ is required 因為php版本低於5.2版 1 php -v @解決方式: a. 安裝epel 及 remi (remi需要epel; 故先安裝epel, 再安裝remi) 1 wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm wget http://rpms.famillecollet.com/el5.i386/remi-release-5-8.el5.remi.noarch.rpm epel-release-5-4.noarch.rpm與remi-release-5-8.el5.remi.noarch.rpm下載時可以查尋是否有最新版本 b. rpm安裝 1 rpm -Uvh epel-release-5-4.noarch.rpm rpm -Uvh remi-release-5-8.el5.remi.noarch.rpm c. 指定remi套件, update php及mysql 1 yum --enablerepo=remi update php mysql 重新啟動php, mysql 1 service httpd restart service mysqld restart ———————————————————————- II. 問題2 進入phpMyAdmin, 出現 未安裝mcypt, mstring 設定檔案現在需要密碼 (passphrase) (blowfish_secret). @解決方式 a. mcrypt及mstring 1 yum --enablerepo=remi install php-mcrypt php-mstring (若以下方式, 可能無法安裝) yum install php-mcrypt yum install php-mstring b. 設定檔案現在需要密碼 於/var/www/phpMyAdmin/config.inc.php (可修改config.sample.inc.php) 修改 1 $cfg['blowfish_secret'] = '輸入一亂碼, 作cookie認證' 重新啟動apache 1 service httpd restart |
7 樓住戶:jack 發表時間:2014-11-17 |
How To Downgrade RPM Package Using YUM ON APRIL 1 | IN LINUX | BY SOHAIL RIAZ | WITH NO COMMENTS In this howto I will describe how to Downgrade a RPM Package Using YUM. Yum came with a plugin named yum-allowdowngrade which allow you to downgrade any existing install RPM to older version. This requirement came from one of my client server that it requires to downgrade PHP version from 5.3.8 to 5.2.17. 1) Check Already Installed RPM and Required RPM Following command will check which rpm version is installed. rpm -qa | grep php The next command will show you all available version using yum. Be noted I am using atomic repository for my PHP upgrade and downgrade. But you can do this with any rpm hence yum provide you with lower version of rpm package. How to add atomic repository kindly see my following post http://www.sohailriaz.com/how-to-update-php-on-servers-centosfedorarhel/ yum list | grep php | grep atomic 2) Install YUM Plugin Issue following command to install yum-allowdowngrade plugin yum -y install yum-allowdowngrade 3) Downgrade RPM Install First you should be sure what rpm’s you are going to downgrade. For my list I will using already install PHP rpm package name with downgrade argument, which let yum to automatically use the lower version to install and remove the current version of PHP. yum downgrade php-dba php-soap php-ldap php-mysql php-mcrypt php-common php-cli php-gd php-odbc php-xmlrpc php-snmp php-bcmath php-imap- php-devel php-pdo php php-pgsql php-pgsql php-mbstring php-xml The above command detect the lower version 5.2.17 at itself and give me option to downgrade the php version to 5.2.17. By giving y to start the installation, it removes the current php version, save the configuration files and install the older version of php 5.2.17. Which was than verified using following commands rpm -qa | grep php shows install php rpm with version, additionally you can use php command with version option php –version |
8 樓住戶:joe 發表時間:2014-11-17 |
http://www.if-not-true-then-false.com/2010/yum-downgrade-packages-on-fedora-centos-red-hat-rhel/ YUM Downgrade Basic Usage Downgrade is very straightforward when package have not any dependencies, which affect the downgrade. YUM Downgrade Single Package yum downgrade package Example: yum downgrade hunspell-mr.noarch Setting up Downgrade Process Resolving Dependencies --> Running transaction check ---> Package hunspell-mr.noarch 0:20060920-5.fc13 set to be downgraded ---> Package hunspell-mr.noarch 0:20060920-6.fc14 set to be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Downgrading: hunspell-mr noarch 20060920-5.fc13 fedora 62 k Transaction Summary ================================================================================ Downgrade 1 Package(s) Total download size: 62 k Is this ok [y/N]: y Downloading Packages: hunspell-mr-20060920-5.fc13.noarch.rpm | 62 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : hunspell-mr-20060920-5.fc13.noarch 1/2 Cleanup : hunspell-mr-20060920-6.fc14.noarch 2/2 Removed: hunspell-mr.noarch 0:20060920-6.fc14 Installed: hunspell-mr.noarch 0:20060920-5.fc13 Complete! YUM Downgrade Package Which Have Dependencies YUM downgrade is more difficult with packages that have dependencies. YUM downgrade does not resolve dependencies automatically, so it must be done manually. YUM Downgrade Package and Dependencies yum downgrade lib1 lib2 package Example: check package dependencies manually yum downgrade sqlite Setting up Downgrade Process Resolving Dependencies --> Running transaction check ---> Package sqlite.i686 0:3.6.22-1.fc13 set to be downgraded ---> Package sqlite.i686 0:3.6.23-1.fc14 set to be erased --> Finished Dependency Resolution Error: Package: sqlite-devel-3.6.23-1.fc14.i686 (@rawhide/12) Requires: sqlite = 3.6.23-1.fc14 Removing: sqlite-3.6.23-1.fc14.i686 (@rawhide/12) sqlite = 3.6.23-1.fc14 Downgraded By: sqlite-3.6.22-1.fc13.i686 (fedora) sqlite = 3.6.22-1.fc13 You could try using --skip-broken to work around the problem SQLite package depends on sqlite-devel package, so both (sqlite-devel and sqlite) have to be downgraded: yum downgrade sqlite-devel sqlite Setting up Downgrade Process Resolving Dependencies --> Running transaction check ---> Package sqlite.i686 0:3.6.22-1.fc13 set to be downgraded ---> Package sqlite.i686 0:3.6.23-1.fc14 set to be erased ---> Package sqlite-devel.i686 0:3.6.22-1.fc13 set to be downgraded ---> Package sqlite-devel.i686 0:3.6.23-1.fc14 set to be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Downgrading: sqlite i686 3.6.22-1.fc13 fedora 309 k sqlite-devel i686 3.6.22-1.fc13 fedora 80 k Transaction Summary ================================================================================ Downgrade 2 Package(s) Total download size: 389 k Is this ok [y/N]: y Downloading Packages: (1/2): sqlite-3.6.22-1.fc13.i686.rpm | 309 kB 00:00 (2/2): sqlite-devel-3.6.22-1.fc13.i686.rpm | 80 kB 00:00 -------------------------------------------------------------------------------- Total 438 kB/s | 389 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : sqlite-3.6.22-1.fc13.i686 1/4 Installing : sqlite-devel-3.6.22-1.fc13.i686 2/4 Cleanup : sqlite-devel-3.6.23-1.fc14.i686 3/4 Cleanup : sqlite-3.6.23-1.fc14.i686 4/4 Removed: sqlite.i686 0:3.6.23-1.fc14 sqlite-devel.i686 0:3.6.23-1.fc14 Installed: sqlite.i686 0:3.6.22-1.fc13 sqlite-devel.i686 0:3.6.22-1.fc13 Complete! |
姓名: | |||
佈告內容: | |||
其他選項: | |||
|