Skip to content

Instantly share code, notes, and snippets.

@co3k
Created February 12, 2010 12:49
Show Gist options
  • Save co3k/302529 to your computer and use it in GitHub Desktop.
Save co3k/302529 to your computer and use it in GitHub Desktop.

Setup PHP for opPluginChannelServerPlugin on CentOS 5.4

Install packages

# yum install libxml2-devel curl-devel libjpeg-devel libpng-devel libmcrypt-devel

Build PHP and install

Note

I added "--with-zlib" "--with-libdir=lib64" options

# cd /usr/local/src
# wget http://jp2.php.net/get/php-5.2.12.tar.bz2/from/jp.php.net/mirror
# tar xvf php-5.2.12.tar.bz2
# cd php-5.2.12
# ./configure --enable-mbstring --enable-libxml --with-pcre-regex --enable-pdo\
--enable-json --with-gd --with-mcrypt --with-apxs2 --without-sqlite --with-mysql\
--with-mysql-sock --with-openssl --with-curl --with-pdo-mysql --with-jpeg-dir\
--with-zlib  --with-zlib --with-libdir=lib64
# make
# make install
# /usr/local/src/php-5.2.12/libtool --finish /usr/local/src/php-5.2.12/libs

Creation php.ini

# cp /usr/local/src/php-5.2.12/php.ini-recommended /usr/local/lib/php.ini

Install APC

# yum install autoconf
# pecl install apc

Change "extension_dir" in /usr/local/lib/php.ini:

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"

Add the following lines to /usr/local/lib/php.ini:

[apc]
extension=apc.so

Configure Apache for PHP

# echo "AddHandler application/x-httpd-php .php" > /etc/httpd/conf.d/php5.conf

Restart Apache

# /etc/init.d/httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment