要在OpenWrt上搭建PHP開發環境,您可以按照以下步驟進行操作:
opkg update
opkg install php
opkg install php7-mod-mysqli
/etc/init.d/php-fpm enable
/etc/init.d/php-fpm start
opkg update
opkg install nginx
/etc/init.d/nginx enable
/etc/init.d/nginx start
server {
listen 80;
server_name example.com;
root /path/to/your/php/application;
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
通過以上步驟,您可以在OpenWrt上搭建PHP開發環境并開始開發PHP應用程序。希望以上信息能夠對您有所幫助!