Apache uses one of the following Multi-Processing Module (MPM) for handling incoming requests and processes them. It modifies basic functionality of the Apache server related to multi-thread and multi-processes style of working. Only one MPM can be loaded into the server at any time.
What is Worker MPM?
Worker MPM uses multiple child processes and each child process can have many threads and each thread handles one connection at a time. It is good choise for high-traffic servers because it has smaller memory footprint than the prefork MPM and has higher performance. It is Apache 2.0 based. It does not provide the same level of isolation such as request-to-request, as a process based MPM does.
Read More about Apache MPM :- What is Apache MPM?
In this article I will show you how to compile PHP 5.6 with Apache Worker Support.
Download PHP 5.6
Download PHP 5.6 if not downloaded yet.
# wget http://us1.php.net/distributions/php-5.6.4.tar.xz
Extract xz File
Type below command to unpack the file.
# tar xJvf php-5.6.4.tar.xz
To Install Dependencies Download And Run The Script
Now download and run the below script to install dependencies:
# wget --no-check-certificate https://raw.githubusercontent.com/yoander/sysadmin/master/shscript/php-dev-install-dep.sh # chmod a+x -c php-dev-install-dep.sh && # ./php-dev-install-dep.sh apache-worker
Download Script To Compile PHP
After installing dependencies now download the below script to compile PHP.
# wget --no-check-certificate https://raw.githubusercontent.com/yoander/sysadmin/master/shscript/php-build.sh # chmod a+x -c php-build.sh
# ./php-build.sh -at php-5.6.4
–a : To support Apache
–t : Support multithreading (thread safe)
Now install PHP.
# cd php-5.6.4 # make install
Create A PHP Configuration File
Now creare a PHP configuration file.
For Development Environment
# cp -v php.ini-development /etc/php/php.ini
For Production Environment
# cp -v php.ini /etc/php/php.ini
Now restart Apache.
# service httpd restart
Now verify, is everything is file.
Open your browser and type the below URL: