C로 CGI 프로그램을 작성하려고합니다. 배우기에 재미가있는 것처럼 보였습니다. Apache/CGI 오류와 관련된 문제가 있습니다. 하나의 매우 구체적인 라인. 이 특정 라인을 주석 처리하거나 제거하면 완벽하게 정상적으로 작동하지만 포함되어 있으면 매번 폭탄이 터집니다.C CGI 프로그램에서 Apache 오류가 발생했습니다.
struct site_link
{
char *name;
char *url;
};
struct blog_data
{
char *blog_name;
struct site_link *links;
} blog;
blog.blog_name = "richardwagner.io";
blog.links[0].url = "Home"; // <-- this line right here
blog.links[0].name = "Home";
blog.links[1].url = "Posts";
blog.links[1].name = "Posts";
blog.links[2].url = "About";
blog.links[2].name = "About";
'디버그'수준 로깅을 사용하는 Apache 로그가 켜져 있습니다.
[Mon Dec 15 10:27:38.906961 2014] [authz_core:debug] [pid 63010] mod_authz_core.c(799): [client 192.168.1.104:49922] AH01626: authorization result of Require all granted: granted
[Mon Dec 15 10:27:38.906982 2014] [authz_core:debug] [pid 63010] mod_authz_core.c(799): [client 192.168.1.104:49922] AH01626: authorization result of <RequireAny>: granted
[Mon Dec 15 10:27:38.907020 2014] [authz_core:debug] [pid 63010] mod_authz_core.c(799): [client 192.168.1.104:49922] AH01626: authorization result of Require all granted: granted
[Mon Dec 15 10:27:38.907026 2014] [authz_core:debug] [pid 63010] mod_authz_core.c(799): [client 192.168.1.104:49922] AH01626: authorization result of <RequireAny>: granted
[Mon Dec 15 10:27:39.186804 2014] [cgi:error] [pid 63010] [client 192.168.1.104:49922] End of script output before headers: tblog
내가 며칠 동안이 문제를 해결하려고 노력하고 봤는데, 그냥하더라도, 그 한 줄에 좋은 플레이를 할 수 없다, 나에게, 그것은 다른 몇 거의 동일 보인다 아래 라인.
나는 뭔가를 잊어 버릴 줄 알았다. 나는 또한 이것보다 전에 Content-type blah-blah 라인을 가지고있다. –