php:buildphpapachenginxfromsource
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
php:buildphpapachenginxfromsource [2017/04/22 05:35] – [Memcache Admin] admin | php:buildphpapachenginxfromsource [2024/10/28 05:24] (current) – [Basic config] admin | ||
---|---|---|---|
Line 5: | Line 5: | ||
yum install gcc-c++ | yum install gcc-c++ | ||
yum install automake | yum install automake | ||
+ | yum install make | ||
</ | </ | ||
===== Build and config PHP and Nginx ===== | ===== Build and config PHP and Nginx ===== | ||
Line 240: | Line 241: | ||
restart(){ | restart(){ | ||
- | | + | |
- | sleep 2 | + | sleep 2 |
- | start | + | start |
} | } | ||
rh_status(){ | rh_status(){ | ||
- | | + | |
} | } | ||
Line 278: | Line 279: | ||
yum install libxml2-devel | yum install libxml2-devel | ||
yum install libxslt-devel | yum install libxslt-devel | ||
+ | yum install bison bison-devel | ||
</ | </ | ||
* step2: Build libmcrypt: libmcrypt-2.5.8.tar.gz | * step2: Build libmcrypt: libmcrypt-2.5.8.tar.gz | ||
Line 286: | Line 288: | ||
</ | </ | ||
| | ||
- | * step4: Build php-fpm (add option **--enable-fpm**)< | + | * Step4:If you don't find file configure, run script below< |
+ | ./buildconf --force | ||
+ | </ | ||
+ | * step5: Build php-fpm (add option **--enable-fpm**)< | ||
tar zxvf php-5.3.28.tar.gz | tar zxvf php-5.3.28.tar.gz | ||
cd php-5.3.28 | cd php-5.3.28 | ||
Line 292: | Line 297: | ||
make & make install | make & make install | ||
cp php.ini-production / | cp php.ini-production / | ||
+ | </ | ||
+ | === Build PHP7.4 with php-fpm === | ||
+ | <code bash> | ||
+ | ./configure --prefix=/ | ||
+ | </ | ||
+ | configure: error: Package requirements (oniguruma) were not met | ||
</ | </ | ||
=== Script start php-fpm === | === Script start php-fpm === | ||
Line 563: | Line 574: | ||
===== Memcache ===== | ===== Memcache ===== | ||
==== Build and Install Memcache server ==== | ==== Build and Install Memcache server ==== | ||
- | - step1: Install | + | - step1: Install |
yum install libevent-devel | yum install libevent-devel | ||
</ | </ | ||
- | - step2: | + | - step2: |
wget http:// | wget http:// | ||
</ | </ | ||
- | - step3: | + | - step3: |
tar xvf memcached-1.4.22.tar.gz | tar xvf memcached-1.4.22.tar.gz | ||
cd memcached-1.4.22 | cd memcached-1.4.22 | ||
Line 709: | Line 720: | ||
</ | </ | ||
- Step3: download and install depedency packages< | - Step3: download and install depedency packages< | ||
- | / | + | / |
</ | </ | ||
- Step4: Go to directory app and copy .config.dist to .config:< | - Step4: Go to directory app and copy .config.dist to .config:< | ||
cd app | cd app | ||
cp .config.dist .config | cp .config.dist .config | ||
+ | </ | ||
+ | - Step5: Change admin password in .config< | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | - Step6: config nginx with php-fpm for run this website:< | ||
+ | server { | ||
+ | listen | ||
+ | server_name | ||
+ | root / | ||
+ | |||
+ | index index.html index.htm index.php; | ||
+ | fastcgi_index | ||
+ | |||
+ | access_log / | ||
+ | error_log / | ||
+ | |||
+ | error_page | ||
+ | error_page 500 502 503 504 /50x.html; | ||
+ | |||
+ | location ~* " | ||
+ | access_log | ||
+ | expires | ||
+ | } | ||
+ | |||
+ | location / { | ||
+ | index index.html index.php; ## Allow a static html file to be shown first | ||
+ | try_files $uri $uri/ @handler; ## If missing pass the URI to zend framework' | ||
+ | expires 30d; ## Assume all files are cachable | ||
+ | } | ||
+ | location @handler { ## zend framework uses a common front handler | ||
+ | rewrite / /index.php; | ||
+ | } | ||
+ | location ~ .php/ { ## Forward paths like / | ||
+ | rewrite ^(.*.php)/ $1 last; | ||
+ | } | ||
+ | location ~ \.php$ { | ||
+ | if (!-e $request_filename) { rewrite / /index.php last; } | ||
+ | fastcgi_pass | ||
+ | fastcgi_param | ||
+ | include | ||
+ | } | ||
+ | } | ||
</ | </ | ||
===== Varnish Cache ===== | ===== Varnish Cache ===== | ||
Line 1016: | Line 1094: | ||
session.name = PHPSESSID | session.name = PHPSESSID | ||
session.save_path = "/ | session.save_path = "/ | ||
+ | upload_max_filesize = 20M | ||
+ | post_max_size = 20M | ||
</ | </ | ||
==== PHP check ==== | ==== PHP check ==== |
php/buildphpapachenginxfromsource.1492839332.txt.gz · Last modified: 2022/10/29 16:15 (external edit)