忍者ブログ

鯖設定とプログラム

メモ。

<< | 2024/05 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | >>

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

PHP5にアップグレードする RHEL4(RedHat Enterprise Linux ES v4)

ローカルサーバのPHPを4.3.9から5.1.5にアップグレードした。
OS:RedHat Enterprise Linux ES v4

現時点での最新は5.2.0だが、公開サーバが5.1.5なので、まずはこれに合わせる。
http://jp.php.net/get/php-5.1.5.tar.gz/from/a/mirror

ダウンロードしたファイルを
/usr/local/src/
に移動

# cd /usr/local/src/
# ls -al
php-5.1.5.tar.gz

# tar jxvf php-5.1.5.tar.gz
# cd php-5.1.5

# ./configure --prefix=/usr/local --bindir=/usr/local/bin/ --with-apxs2=/usr/sbin/apxs --with-mysql=/usr --enable-mbstr-enc-trans --enable-mbstring --enable-mbregex --enable-track-vars --with-freetype-dir=/usr --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-regex --with-xml --with-expat-dir=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --without-oci8 --with-pear --with-kerberos=/usr/kerberos --with-ldap=shared --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-pdo-mysql --enable-mcal

途中でconfigure: error: no acceptable cc found in $PATHというエラーが出たらコンパイラが無い
Xで開発ツールというのをインストール

Sorry, I cannot run apxs.  Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

The output of /usr/sbin/apxs follows:
./configure: line 6335: /usr/sbin/apxs: No such file or directory
configure: error: Aborting

このエラーはhttpd-devel-2.0.52-28.entが無い
up2dateかCD5に入っている。
# up2date --install httpd-devel*

libjpeg.(a|so) not foundでエラー
libjpegのdevelがインストールされていない。CDから探すか
# up2date --install libjpeg*

同じくlibpngも見つからないと怒られるだろうから、
# up2date --install libpng*

次はconfigure: error: freetype2 not found!と怒られる。
# up2date --install freetype*

次はconfigure: error: Cannot find pspellと怒られる。
これは結構悩んだ。pspellってなんだと・・・。結局はこれの事。
# up2date --install aspell*
これは結構沢山インストールされるけど問題なし。
# rpm -qa | grep aspell
aspell-it-0.53-1
aspell-0.50.5-3.fc3
aspell-de-0.50-9
aspell-devel-0.50.5-3.fc3
aspell-nl-0.50-5
aspell-en-0.51-11
aspell-cs-0.51-1
aspell-sv-0.50-6
aspell-fr-0.50-7
aspell-da-0.50-10
aspell-pt-0.50-8
aspell-pl-0.51-2
aspell-cy-0.50-1
aspell-el-0.50-1
aspell-es-0.50-10
aspell-no-0.50.1-7
aspell-ca-0.50-1

これでようやくconfigureがうまくいく。

# ./configure --prefix=/us(省略:上の方を参照)
# make clean
# make

わーっと呪文が出るがビビらず待つ。
OKハニーうまくいったぜみたいな感じになれば、

アパッチを止める
/etc/init.d/httpd stop
インストール
# make install
アパッチ起動
/etc/init.d/httpd start

PHPを4.3.9関連を直す。ここにあるPHPをリネーム
# cd /usr/bin/
# mv php php.org
インストールした方にシンボリックリンクを張る
# ln -s /usr/local/bin/php php
# ls -al | grep php
php -> /usr/local/bin/php
php.org

php4_moduleを読み込まなくする。
# vi /etc/httpd/conf.d/php.conf
LoadModule php4_module modules/libphp4.so
をコメントアウト
#LoadModule php4_module modules/libphp4.so

/etc/httpd/conf/httpd.confにはphp5のモジュールの項目が追加されている。
php4_moduleはないのでここで問題に陥りやすい。LoadModule郡の終わりの次に、
-----------------
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf
-----------------
ここでphp4_moduleが読み込まれてる。これに気づかず1日をムダにした。
これを忘れていると、現象では、IEでアクセスするとページが存在しない。
FIREFOXでアクセスするとダウンロードポップアップが出る(ファイルは空)。
コマンドではちゃんと動いている。
#php info.php
info.phpの中身
<?php phpinfo() ?>

/usr/local/etc/にphp.iniを置く

apacheを再起動。
# /etc/init.d/httpd restart

http://localhost/~ninja/info.php

ざーーっとPHP5.1.5の情報が表示されれば完了。
PR
...
Oh, its great!

Commented on 2009/02/02 Monday 17:15:18

by Online poker | コメント編集

この記事にコメントする







  Vodafone絵文字入力用パレット表示ボタン i-mode絵文字入力用パレット表示ボタン Ezweb絵文字入力用パレット表示ボタン

この記事へのトラックバック




ブログ内検索
カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
プロフィール
HN:
No Name Ninja
性別:
非公開
自己紹介:
へなちょこサーバ管理者

HPは作れるがプログラムが出来なかったので、PHPを覚えた。

公開サーバ環境:
CPU:Pentium M 740 1.73GHz
Mem:512MB DDR2
HDD1:160GB SATA
HDD2:160GB SATA
OS:RedHat Enterprise Linux ES v4
Apache:httpd-2.0.52-28ent
MySQL:mysql-4.1.20-1
PHP:php-5.2.5
JavaSE:JDK6
Tomcat:apache-tomcat-5.5.20
Apache Tomcat Connector:jk-1.2.19

ローカルサーバ環境:
DELL INSPIRON4000
OS:RedHat Enterprise Linux ES v4
Apache:httpd-2.0.52-28ent
MySQL:mysql-4.1.20-1
PHP:php-5.2.5
JavaSE:JDK6
Tomcat:apache-tomcat-5.5.20
Apache Tomcat Connector:jk-1.2.19

ローカルPC
OS:Windows7
最新コメント
[03/14 mietwagen]
[02/02 Online poker]
[03/13 ほし]
[03/01 へなとこ]
[11/14 ポポ]
アクセス解析
?
カウンター
起動、終了、再起動
Apacheの起動
/etc/init.d/httpd start
Apacheの終了
/etc/init.d/httpd stop
Apacheの再起動
/etc/init.d/httpd restart

Tomcatの起動
/usr/local/tomcat/bin/startup.sh
Toncatの終了
/usr/local/tomcat/bin/shutdown.sh

MySQLの起動
/etc/rc.d/init.d/mysqld start
MySQLの終了
/etc/rc.d/init.d/mysqld stop
MySQLの再起動
/etc/rc.d/init.d/mysqld restart

vsftpdの起動
/etc/init.d/vsftpd start
vsftpdの終了
/etc/init.d/vsftpd stop
vsftpdの再起動
/etc/init.d/vsftpd restart
場所
httpd.conf
/etc/httpd/conf/httpd.conf

AdminControlMenu: AdminMenu | NewEntry | EditComment | EditTrackback

忍者ブログ [PR]