PHP

PHP FPM

PHP-FPM is an alternative PHP FastCGI implementation with some additional features (mostly) useful for heavy-loaded sites.

PHP Installation
Configure PHP:

./configure \
--with-config-file-path=/usr/local/etc/ \
--enable-fpm \
--enable-pdo \
--enable-mbstring \
--with-gd \
--with-curl \
--with-jpeg-dir \
--with-bz2 \
--with-zlib \
--with-pdo-mysql=/usr/local/mysql

Build and install:

make
make install

Copy the default configuration files:

Technology:

Zend OPcache

PHP 5.5 includes the Zend OPcache and is built by default unless the building of default extensions was disabled with --disable-all.
Enable OPcache by uncomment/adding some default settings in /usr/local/php/php.ini:

Technology:

nginx

PHP Installation
Configure PHP:

./configure \
--with-config-file-path=/usr/local/etc/ \
--enable-fpm \
--enable-pdo \
--enable-mbstring \
--with-gd \
--with-curl \
--with-jpeg-dir \
--with-bz2 \
--with-zlib \
--with-pdo-mysql=/usr/local/mysql

Build and install:

make
make install

Copy the default configuration files:

Technology:

FastCGI

FastCGI is a protocol for interfacing interactive programs with a web server. It's main aim is to reduce the overhead associated with interfacing the web server and CGI programs, allowing a server to handle more web page requests at once.

Technology:

spawn-fcgi

spawn-fcgi allows you to run FastCGI separate from Lighttpd.

cd /extra/src
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz
tar zxf spawn-fcgi-1.6.3
cd spawn-fcgi-1.6.3

Automatic Startup
FastCGI can be supervised by daemontools.
Assuming you have already installed daemontools, create the directories to hold the lighttpd run script, logging script, and config files:

cd /var/service
mkdir -m 1755 fast-cgi
cd fast-cgi

Create the run script (/var/service/fast-cgi/run), with the following:

Technology:

Xcache

XCache is a open-source opcode cacher, which means that it accelerates the performance of PHP on servers. It optimizes performance by removing the compilation time of PHP scripts by caching the compiled state of PHP scripts into the shm (RAM) and uses the compiled version straight from the RAM. This will increase the rate of page generation time by up to 5 times as it also optimizes many other aspects of php scripts and reduce server load.

Requirements
If phpize complains about being unable to find autoconf:

yum install autoconf

Installation with Lighttpd
Download the latest release of Xcache:

cd /extra/src
wget http://xcache.lighttpd.net/pub/Releases/1.3.2/xcache-1.3.2.tar.gz
tar zxf xcache-1.3.2.tar.gz
cd xcache-1.3.2
phpize
./configure --enable-xcache
make
make install

Copy the default configuration into your php.ini:

Technology:

FastCGI

FastCGI is a language independent, scalable, open extension to CGI that provides high performance and persistence without the limitations of server specific APIs.

Installation
Install fastcgi libraries:

cd /extra/src
wget http://www.fastcgi.com/dist/fcgi-current.tar.gz
tar zxf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure
make
make install

Download the mod_fastcgi source:

cd /extra/src
wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
tar zxf mod_fastcgi-current.tar.gz
cd mod_fastcgi-2.4.6
cp Makefile.AP2 Makefile
make
make install

PHP Configuration
In addition to any other directives, PHP needs to be configured with:

--enable-fastcgi \

Technology:

Pages

Subscribe to RSS - PHP

Recent Updates

  • PHP
    1 year 7 months ago
    PHP 7.4
  • 1 year 7 months ago
    MariaDB 10.4.12
  • 1 year 7 months ago
    Dovecot 2.3.10
  • 1 year 7 months ago
    CentOS 6 revisions
  • 1 year 7 months ago
    Copy of the revision from Wed, 08/22/2018 - 13:39.