You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't want to install php on our OpenWRT since it's too big,We can write a small cgi in c(like php)
You must finish the No.2 and No.3 issue first
cd /home/workplace/OpenWrt-SDK-ramips-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2
cd package/helloworld/src/
vi helloworld.c #content as follow#include <stdio.h>#include <stdio.h> //getenv
int main(void){
printf("Content-Type: text/html\n\n");
printf("GET:%s\n",getenv("QUERY_STRING"));return 0;
}
cd ../../../
make
cd bin/ramips/packages/
scp helloworld_1_ramips_24kec.ipk root@192.168.8.1:/usr/bin
ssh root@192.168.8.1
cd /usr/bin
opkg install helloworld_1_ramips_24kec.ipk
cd /webroot/
mkdir cgi-bin
cd cgi-bin
cp /bin/helloworld ./
OpenWRT C CGI helloworld!
We don't want to install php on our OpenWRT since it's too big,We can write a small cgi in c(like php)
You must finish the No.2 and No.3 issue first
visit
http://192.168.8.1:81/cgi-bin/helloworld?helloworld=cgiFor more about cgi c ,refer to http://blog.csdn.net/kaloha3/article/details/8548027
The text was updated successfully, but these errors were encountered: