Skip to content

Instantly share code, notes, and snippets.

@steel1990
Last active August 29, 2015 14:00
Show Gist options
  • Save steel1990/11134041 to your computer and use it in GitHub Desktop.
Save steel1990/11134041 to your computer and use it in GitHub Desktop.
Install apache and php

Install apache and php

Install apache

wget httpd-2_x_nn.tar.gz
tar -zxvf httpd-2_x_nn.tar.gz
cd httpd-2_x_nn
./configure --enable-so --prefix=/path/to/apache/want/to/install
make
make install

install php

wget php-nn.tar.gz
tar -zxvf php-nn.tar.gz
cd php-nn
./configure --enable-opcache --with-apxs2=/path/to/apache/bin/apxs --prefix=/path/to/php/want/to/install
make
make install
cp php.ini-development /path/to/php/lib/php.ini

config apache

vi apache/conf/httpd.conf
change listen port
change documentRoot or alias path

support php

LoadModule php5_module modules/libphp5.so
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

support opcache

vi /path/to/php/lib/php.ini
+ zend_extension=opcache.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment