CubieTruck:Php+Nginx

来自WHY42

安装nginx和php

apt-get install nginx
apt-get install php5 php-pear php-fpm

配置

修改/etc/nginx/sites-available/default

location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

重启nginx:

/etc/init.d/nginx restart

测试

在/var/www/html下新建一个index.php试试:

<?php phpinfo(); ?>

页面如下:

PHP Version 5.6.20-0+deb8u1

System	Linux cubietruck 3.4.79 #1 SMP PREEMPT Thu Dec 25 09:30:25 CST 2014 armv7l
Build Date	Apr 27 2016 18:43:08
Server API	FPM/FastCGI
...

部署应用

部署一个dokuwiki。

apt-get install lrzsz
rz #上传tgz包

tar -zxvf dokuwiki-3203a8fa2af3c3d5304bfdecb210ec5d.tgz 
mv dokuwiki w
chown -R www-data:www-data w

注意其中的www-data是nginx的用户,在/etc/nginx/nginx.conf中有配置。然后访问localhost/w/install.php安装即可。