Top > Install Log > CentOS5 > php
AND OR

PHPの導入

PHPのインストール

ここまでの過程で、PHPのベースはインストールされている。

php.i386                                 5.1.6-15.el5           installed
php-cli.i386                             5.1.6-15.el5           installed
php-common.i386                          5.1.6-15.el5           installed
php-ldap.i386                            5.1.6-15.el5           installed
php-mysql.i386                           5.1.6-15.el5           installed
php-odbc.i386                            5.1.6-15.el5           installed
php-pdo.i386                             5.1.6-15.el5           installed
php-pear.noarch                          1:1.4.9-4              installed

追加で必要なパッケージをインストールする。

# yum install php-devel php-dba php-imap php-gd php-mbstring php-mcrypt
  php-mhash php-xml php-xmlrpc

PHPの設定

PHPの設定ファイルは、/etc/php.iniにある。 ちなみに、モジュール関係の設定は、/etc/php.d以下ににある。

# vi /etc/php.ini

設定内容としては、次の内容を追加すると良いかも。

output_buffering = Off
output_handler = none
...
expose_php = Off
...
memory_limit = 128M
...
post_max_size = 20M
...
magic_quotes_gpc = On
...
extension_dir = "/usr/lib/php/modules" ←ここはデフォルトのまま
...
file_uploads = On
upload_max_filesize = 20M
...
sendmail_path = /usr/sbin/sendmail -t -i ←ここはデフォルトのまま
...
session.save_path = "/var/lib/php/session" ←ここはデフォルトのまま
session.use_only_cookies = On
session.bug_compat_warn = 0
session.entropy_length = 32
session.entropy_file = /dev/urandom
session.hash_function = 1
...
default_charset = UTF-8
mbstring.language = Japanese
mbstring.encoding_translation = Off
mbstring.http_input = auto
mbstring.http_output = UTF-8
mbstring.internal_encoding = UTF-8
mbstring.substitute_character = none

設定できたら、httpdを再起動。

# service httpd restart

eAcceleratorのインストール

DAGからインストールするだけ。楽ちんだー(笑)

# yum --enablerepo=rpmforge install php-eaccelerator

eAcceleratorの設定

eAcceleratorの設定は、/etc/php.d/eaccelerator.iniにある。

# vi /etc/php.d/eaccelerator.ini

あとは、Vineのときの設定を参考に、次のような内容に編集する。

; Enable eAccelerator extension module
zend_extension = /usr/lib/php/modules/eaccelerator.so
; Options for the eAccelerator module
eaccelerator.cache_dir = /var/cache/php-eaccelerator
eaccelerator.shm_size = "16" ←ここを変更
eaccelerator.enable = 1
eaccelerator.optimizer = 1
eaccelerator.check_mtime = 1
eaccelerator.filter = ""
eaccelerator.shm_max = 0
eaccelerator.shm_ttl = "86400" ←ここを変更
eaccelerator.shm_prune_period = "86400" ←ここを変更
eaccelerator.shm_only = 0
eaccelerator.compress = 1
eaccelerator.compress_level = 9
eaccelerator.keys = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"
eaccelerator.debug = 0

設定できたら、httpdを再起動。

# service httpd restart

あれ、コントロール用のスクリプト(control.php)はどこだろう。

# find / -name "control.php" -print
/usr/share/doc/php-eaccelerator-5.1.6_0.9.5.2/control.php

参考


リロード   差分   ホーム 一覧 検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: Tue, 11 Mar 2014 20:20:22 JST (3696d)