wget http://jp.php.net/distributions/php-5.2.8.tar.gz
wget http://freshmeat.net/redir/libjpeg/5665/url_tgz/jpegsrc.v6b.tar.gz
wget ftp://ftp.cac.washington.edu/imap/imap-2007e.tar.gz
2.PHP関連のrpmをインストールします
yum install openssl-devel
yum install libpng-devel
yum install freetype-devel
yum install zlib-devel
3.PHP関連ツールをインストールします
- jpegサポート
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
mkdir /tmp/jpeg-6b
mkdir /tmp/jpeg-6b/bin
mkdir /tmp/jpeg-6b/include
mkdir /tmp/jpeg-6b/lib
mkdir /tmp/jpeg-6b/man
mkdir /tmp/jpeg-6b/man/man1
./configure --prefix=/tmp/jpeg-6b
make
make install-lib
make install
- imap-2007e
tar zxvf imap-2007e.tar.gz
cd imap-2007e
make lr5
mkdir lib include
cd c-client/
cp *.h ../include/
cp *.c ../lib/
cp c-client.a ../lib/libc-client.a
4.PHPインストール
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-jpeg-dir=/tmp/jpeg-6b --with-png-dir=/usr/lib --with-gd --with-freetype-dir=/usr/lib/ --enable-mbstring --with-zlib --with-mysql=/usr/local/mysql --with-gettext --with-imap=/usr/local/src/imap-2007e --with-mcrypt --with-imap-ssl --with-mime-magic --with-openssl
make
make install
cp php.ini-recommand /usr/local/php/lib/php.ini
5.PHPの設定
- /usr/local/php/lib/php.ini
Uncomment session.save_path = "/tmp"
- libphp5.so
mv /usr/local/httpd/modules/libphp5.so /usr/local/php/
ln -s /usr/local/php/libphp5.so /usr/local/httpd/modules/
- Apache
httpd.confに下の内容を追加します
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
6.PHPのZend Optimizerをインストール
ダウンロード Zend Optimizer 3.3.3
wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.3-linux-glibc23-i386
./install
インストール Zend Optimizer:
>>> Input /usr/local/Zend
# Enter the location of your php.ini file
>>> Input /usr/local/php/lib/
# Are you using Apache Web server?
>>> Input yes
#Specify the full path to the Apache control utility (apachectl)
>>> Input /usr/local/httpd/bin/apachectl
# The following configuration changes have been made:
# - The php.ini file has been relocated from /usr/local/php-5.1.2/lib to /usr/local/ZendOptimizer-2.6.2/etc
# - A symbolic link for the php.ini file has been created in /usr/local/php-5.1.2/lib.
# - The original php.ini was backed up to /usr/local/php-5.1.2/lib/php.ini-zend_optimizer.bak
# The installation has completed successfully.
# Zend Optimizer is now ready for use.
# You must restart your Web server for the modifications to take effect.
# Restart the Web server now?
>>> Input yes
>>> Test is much like php test
>>> What you need to do is create a test php script named phpinfo.php under /var/www/admin_site/htdocs/
>>> There is only one line like in the script
>>> If you can successfully access http://your_server_ip/phpinfo.php and see something like the following information in phpinfo, it's OK!
Zend Engine vX.Y.Z, copyright (c) 1998-2006, Zend Technologies Ltd., with the Zend Optimizer vX.Y.Z, copyright (c) 1998-2006 Zend Technologies Ltd.