|
|
(11 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | <pre>
| + | See [[install php-fpm from source on centos]] |
− | cd /usr/local/src/
| |
− | | |
− | wget http://us3.php.net/get/php-5.2.17.tar.gz/from/us.php.net/mirror
| |
− | tar zxvf php-5.2.17.tar.gz
| |
− | wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
| |
− | gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
| |
− | | |
− | cd /usr/local/src/php-5.2.17
| |
− |
| |
− | ./configure --prefix=/usr/local/nginx-php --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --disable-pdo --with-mysql --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 -with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-freetype-dir --with-jpeg-dir --enable-zend-multibyte --with-gd --with-libdir=lib64
| |
− | | |
− | | |
− | make
| |
− | make install
| |
− | </pre>
| |
− | | |
− | | |
− | Copy php.ini
| |
− | | |
− | <pre>
| |
− | cp php.ini-recommended /usr/local/nginx-php/lib/php/php.ini
| |
− | </pre>
| |
− | | |
− | | |
− | I have faced problem with curl, so i install url from source as per [[Install php from source]]
| |
− | | |
− | <pre>
| |
− | vi /usr/local/nginx-php/etc/php-fpm.conf
| |
− | </pre>
| |
− | | |
− | | |
− | Find
| |
− | | |
− | <pre>
| |
− | Unix user of processes
| |
− | <!-- <value name="user">nobody</value> -->
| |
− | | |
− | Unix group of processes
| |
− | <!-- <value name="group">nobody</value> -->
| |
− | </pre>
| |
− | | |
− | add below
| |
− | | |
− | <pre>
| |
− | <value name="user">nginx</value>
| |
− | <value name="group">nginx</value>
| |
− | </pre>
| |
− | | |
− | Starting php-fpm
| |
− | | |
− | <pre>
| |
− | /usr/local/nginx-php/sbin/php-fpm start
| |
− | </pre>
| |
− | | |
− | <pre>
| |
− | | |
− | tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
| |
− | | |
− | </pre>
| |
− | | |
− | | |
− | == Configuring Nginx ==
| |
− | | |
− | Edit nginx.conf
| |
− | | |
− | <pre>
| |
− | vi /etc/nginx/nginx.conf
| |
− | </pre>
| |
− | | |
− | Find
| |
− | | |
− | <pre>
| |
− | location / {
| |
− | root html;
| |
− | index index.html index.htm;
| |
− | }
| |
− | <pre>
| |
− | | |
− | Replace with
| |
− | | |
− | <pre>
| |
− | location / {
| |
− | root /home/test/html;
| |
− | index index.html index.htm index.php;
| |
− | }
| |
− | | |
− | location ~ \.php$ {
| |
− | fastcgi_pass 127.0.0.1:9000;
| |
− | fastcgi_index index.php;
| |
− | fastcgi_param SCRIPT_FILENAME /home/test/html$fastcgi_script_name;
| |
− | include fastcgi_params;
| |
− | }
| |
− | </pre>
| |
− | | |
− | Create document root and a test file
| |
− | | |
− | <pre>
| |
− | mkdir -p /home/test/html
| |
− | echo "Testing" > /home/test/html/index.html
| |
− | </pre>
| |
− | | |
− | | |
− | * [[Nginx]]
| |