Tips

nagiosでフリーな監視をしてみよう!~nagiosの構築(7)~

PHPの再コンパイル



(1)以前解凍したPHPのディレクトリに移動します。

# cd /usr/local/src/php-5.4.34


(2)configureのオプションに「–with-mysql」等を追加し、再度実行します。

# ./configure
--with-apxs2=/usr/local/apache2/bin/apxs
--with-gd
--with-jpeg-dir
--with-png-dir
--with-zlib-dir
--with-freetype-dir
--with-snmp
--with-gettext
--enable-gd-native-ttf
--enable-gd-jis-conv
--enable-mysqlnd
--with-mysql=/usr/local/mysql
--with-pdo-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config
--enable-embedded-mysqli
--enable-sockets
--enable-mbstring
--enable-ftp
--enable-zip


(3)再コンパイルをするために、makeを実行します。

# make


(4)pacoに登録しつつ、make installを実行します。

# paco -D make install


(5)設定を反映させるために、httpの再起動を行います。

# service httpd reload
httpd を再読み込み中:                                      [  OK  ]

APCのインストール


APC(Alternative PHP Cache)は、PECLの拡張モジュールです。
PECLで提供されているモジュールはC言語で記述されているため、
PHPで記述されたPEARのライブラリよりも高速に動作すると言われています。

(1)「/usr/local/src」ディレクトリに移動し、wgetコマンドでソースコードをダウンロードします。

# cd /usr/local/src/
# wget http://pecl.php.net/get/APC-3.1.13.tgz


(2)ソースコードを解凍し、解凍したディレクトリに移動します。

# tar xfz APC-3.1.13.tgz
# cd APC-3.1.13


(3)phpizeコマンドでAPCモジュールをコンパイルしています

# phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226


(4)configureを実行します。

# ./configure
--enable-apc
--with-php-config=/usr/local/bin/php-config


(5)makeを実行します。

# make


(6)pacoに登録しつつ、make installを実行します。

# paco -D make install

Linux認定資格 LPICを取るなら・・

Linux資格 「LPIC Lv1」徹底解説 連載目次

Recent News

Recent Tips

Tag Search