Howto: Install PDFlib-Lite and PDFlib on Centos server

To install PDFlib on Centos server, you may follow the guide below,

1. Download the PDFlib-Lite package,

cd /usr/local/src 
wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5.tar

2. Extract and go to PDFlib-Lite folder,

tar -zxvf PDFlib-Lite-7-* 
cd PDFlib-Lite-7.0*

3. Configure PDFlib-Lite,

./configure --prefix=/usr/local

4. Create installation file and install it,

make
make install

5. Once PDFlib-Lite installed, download PDFlib with PECL,

pecl download pdflib

6. Extract and enter the folder,

tar xvzf pdflib-*.tgz 
cd pdflib-*

7. Create configuration file,

phpize

8. Configure, create configuration file and install PDFlib,

./configure
make
make install

9. A pdf.so will be created in your PHP extension folder, check it from PHP info,

php -i | grep extension_dir

10. If it is not exists, add the following line to the php.ini,

extension="pdf.so"

Configure FastCGI to Host PHP from IIS 5.x and 6.x

I want to tell everybody that I am back again after last post from Jan 2011. MGe is lost after the Celebrating the Chinese New Year(I am Chinese, 🙂 ), and it is very sad that 2 relative passed away during the past week. 🙁

Somehow, I will continue sharing my post from here, :-).

Today, I want to guide my reader on how to configure PHP FastCGI for IIS 5.x and 6.x.

Prerequisite,
i) IIS5.x or 6.x installed.
ii) PHP installed.

Step:
Install FastCGI extension,
1. Download the extension from http://www.iis.net/extensions/fastcgi.
2. Install it and you will see it is installed to C:\Windows\System32\inetsrv folder.

Apply FastCGI extension,
i) Configure through command,
Run the follow command,

cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe"

ii) Manually Configure it.
1) Run inetmgr.
2) Right click Web Site and select properties.
3) Click on Home Directory tab.
4) Click on the Configure button.
5) Click on the Add button.
6) In the “Add/Edit Application Extension Mapping”, add the following information,
Executable: C:\Windows\System32\inetsrv\fcgiext.dll
Extension: .php
Verbs: Limit to GET, HEAD, POST
7) Click OK.

Modify the fcgiext.ini file,
1) Add the following information to the fcgiext.ini file,
[Types]
php=PHP
[PHP]
ExePath=C:\PHP\php-cgi.exe

Set the optimal setting for FastCGI,
Set the following value to php.ini,
fastcgi.impersonate = 1
cgi.fix_pathinfo = 1
cgi.force_redirect = 0

Set the following value to fcgiext.ini, run the following script.

cscript fcgiconfig.js -set -section:"PHP" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000

Install Memcache with cPanel that running CentOS

I was trying to install Memcache from cPanel from yesterday night but it seems to be sucks when installing from cPanel control panel.

Hence, I am sharing the step as below which I used to compiled manually from the shell.

Create a temporary folder
1. As it is a manually work, you might want to clear the source file after the installation, so create a folder as command below.

mkdir ~/memcache

Install LibEvent
To install memcache, you will need LibEvent, go to their site to get the latest version.

cd ~/memcache
wget http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar zxvf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
./configure
make
make install

Install Memcache
Now, install the memcache and get the latest version from their site.

cd ~/memcache
wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
tar zxvf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --with-lib-event=/usr/local/
make
make install

Install PHP Memcache
Now, install PECL Memcache and get the latest version.

cd ~/memcache
wget http://pecl.php.net/get/memcache-2.2.6.tgz
tar zxvf memcache-2.2.6.tgz
cd memcache-2.2.6
phpize
./configure
make
make install
vi /usr/local/lib/php.ini

Find the extension as below and if it is not existed, add it in the php.ini.

extension=memcache.so

Restart the Apache services.

service httpd restart