tiddlywiki 在pi上面建立服务器并更新

建立 NGINX 网络服务器在 Raspberry Pi

sudo apt update  
sudo apt install nginx  
sudo /etc/init.d/nginx start

测试网络服务

http://localhost/

安装 PHP

sudo apt install php7.3-fpm  
cd /etc/nginx
sudo vim sites-enabled/default

增加index.php 在 index 后面

index index.php index.html index.htm;

找到如下内容

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# location ~ \.php$ {

去掉#符号

location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
}

应该像这样:


        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;

        # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        # With php-cgi (or other tcp sockets):
    #    fastcgi_pass 127.0.0.1:9000;
        }

重新加载服务器

sudo /etc/init.d/nginx reload

测试 PHP
重命名index.nginx-debian.html 为 index.php:

cd /var/www/html/
sudo mv index.nginx-debian.html index.php

打开 index.php

sudo vim index.php

增加动态 PHP 内容,替代现在的内容

<?php echo phpinfo(); ?>

保存并刷新浏览器,你会看到网页包含php版本,logo和目前的设置

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值