Build apache php from sources
Build Apache
- I use mpm prefork for stable reason.
Default max_clients is 256 .To increase max_clients, edit file ./httpd-2.2.11/server/mpm/prefork/prefork.c
Change #define DEFAULT_SERVER_LIMIT 512
- Check config
./configure \
–prefix=/wwwroot/apache2 \
–with-mpm=prefork \
–enable-fcgid \
–with-included-apr \
–enable-lib64 \
–enable-nonportable-atomics=yes \
–enable-cache \
–enable-disk-cache \
–enable-mem-cache \
–enable-file-cache \
–enable-rewrite \
–enable-expires \
–enable-headers \
–enable-deflate \
–enable-so \
–enable-unique-id \
–disable-autoindex \
–disable-userdir \
–disable-env \
–disable-setenvif \
–disable-status \
–disable-asis \
–disable-negotiation \
–disable-include \
–disable-charset-lite \
$@
make
make install
Build php
./configure –with-apxs2=/wwwroot/apache2/bin/apxs \
–with-mysql \
–enable-mbstring \
–prefix=/wwwroot/apache2/php \
–with-config-file-path=/wwwroot/apache2/php \
–disable-cgi \
–with-zlib \
–with-curl \
–with-curlwrappers \
–with-gettext \
–with-gd=/wwwroot/gd \
–enable-ftp \
download php.ini to /wwwroot/apache2/php
Config apache allow running php
-Edit httpd.conf
Add
AddHandler php5-script .php
AddType text/html .php
Start Apache
/wwwroot/apache2/bin/apachectl start
Recent Comments