树莓派+nginx+php
树莓派+nginx+php建站
Setup a webpage on Raspberry by nginx and php.
1.更新软件源
update the list of softwares
2.安装nginx和php
install nginx and php
也能使用以下命令
also,can use these commands
关于php版本的问题,php5比php7更加稳定。
It looks like that php5 is more stable than php7.
More information on this site: php.net
3.配置nginx
Setup nginx.
nginx的配置文件存放在/etc/nginx/sites-available目录下。
只需要修改该目录下的default配置即可
The configurations of nginx are in /etc/nginx/sites-available.
Just need to edit the default to configure.
根据提示添加index.php,取消php配置前的注释。
Add "index.php" to the below line and unmark the configurations of php.
现在你可以使用其他电脑访问http://<你的树莓派ip>来访问树莓派了。
Now we can browse the site from other computers via "http://
It looks like this.
4.主页
Index.
主页存放目录为/var/www/html/,删除其他文件,创建一个php文件。
The index site is in the /var/www/html/,you can remove other documents and creat index.php.
现在访问树莓派的ip就能看到php的信息了。
Now go ahead to http://
Enjoy!
评论
发表评论