X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AC3E39DC82D for ; Tue, 20 Dec 2005 05:44:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41804-05 for ; Tue, 20 Dec 2005 05:44:11 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 2FB7F9DC9CC for ; Tue, 20 Dec 2005 05:44:08 -0400 (AST) Received: from xiao2.Rinaix2.cn (unknown [61.170.221.254]) by svr4.postgresql.org (Postfix) with ESMTP id 07B6D5AF176 for ; Tue, 20 Dec 2005 09:44:08 +0000 (GMT) Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by xiao2.Rinaix2.cn (8.13.4/8.13.4) with ESMTP id jBK9iiaD014328 for ; Tue, 20 Dec 2005 17:44:48 +0800 Message-ID: <43A7D28C.8040504@Rinaix.cn> Date: Tue, 20 Dec 2005 17:44:44 +0800 From: zhuge xiao User-Agent: Mozilla Thunderbird 1.0.2-6 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Help Me ! Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/231 X-Sequence-Number: 19951 Help me! I have edited the program testlibpq.c which is copied from the PostgreSQL document to make it become a CGI program. And I have succeeded to compile the programme, testlibpq.c from the command line: [zhuge@xiao2 src]$ cc -o testlibpq testlibpq.c -lpq And it can run from the command line: [zhuge@xiao2 src]$ ./testlibpq Then, I copied the excuteable program to the CGI directory, /var/www/cgi-bin. And let it run from the Mozilla Firefox browser whose URL was http://localhost/cgi-bin/testlibpq. But I failed. The result was that the below message was displayed in the browser: could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? The above message was produced by the below code: if (PQstatus(conn) != CONNECTION_OK) { fprintf(stdout, PQerrorMessage(conn)); exit_nicely(conn); } How can I do? Please help me! Thank you very much. zhuge@Rinaix.cn