cgi和php [英] cgi and php
问题描述
我需要做什么才能让php从cgi-bin运行
我尝试的一切都给我一个错误500脚本标题的过早结束
它在虚拟服务器上运行(试图运行)。文件所有者是
与网站管理员相同的uid,并且它被编码为775
文件名为test.php,内容为I尝试过:
--- test.php ----
#! / usr / bin / php
<?php
echo" test";
?>
----结束--------
和:
---- test.php -------
<?php
echo" test.php";
?>
----结束 - ------
What do I need to do to make php run from the cgi-bin
Everything I try gives me an error 500 "premature End of Script Headers"
It is running (trying to run) on a virtual server. The file owner is the
same uid as the site admin and it is chmoded to 775
The name of the file is test.php for the contents I have tried:
---test.php----
#! /usr/bin/php
<?php
echo "test";
?>
----end--------
and:
----test.php-------
<?php
echo "test.php";
?>
----end--------
推荐答案
Jeremy Shovan写道:
Jeremy Shovan wrote:
我需要做什么让php从cgi-bin运行
我尝试的一切都给了我一个错误500脚本标题的过早结束
它正在运行(试图运行)虚拟服务器。文件所有者是与网站管理员相同的uid,并且它被编译为775
对于我尝试过的内容,文件的名称是test.php:
- --test.php ----
#! / usr / bin / php
<?php
echo" test";
?>
----结束--------
和:
---- test.php -------
<?php
echo" test.php" ;;
?> <结束--------
What do I need to do to make php run from the cgi-bin
Everything I try gives me an error 500 "premature End of Script Headers"
It is running (trying to run) on a virtual server. The file owner is the
same uid as the site admin and it is chmoded to 775
The name of the file is test.php for the contents I have tried:
---test.php----
#! /usr/bin/php
<?php
echo "test";
?>
----end--------
and:
----test.php-------
<?php
echo "test.php";
?>
----end--------
另外:
当我运行php -v输出时是:
PHP 4.3.4(cgi)(内置:2003年11月10日10:36:06)
版权所有(c)1997-2003 PHP小组>
Zend Engine v1.3.0,版权所有(c)1998-2003 Zend Technologies
与Zend Extension Manager v1.0.1,版权所有(c)2003,由Zend
Technologies
与Zend Optimizer v2.5.1,版权所有(c)1998-2004,由Zend
Technologies
与Zend Debugger v3。 0.1,版权所有(c)1999-2003,作者Zend
技术
Also:
when I run php -v the output is:
PHP 4.3.4 (cgi) (built: Nov 10 2003 10:36:06)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
with Zend Extension Manager v1.0.1, Copyright (c) 2003, by Zend
Technologies
with Zend Optimizer v2.5.1, Copyright (c) 1998-2004, by Zend
Technologies
with Zend Debugger v3.0.1, Copyright (c) 1999-2003, by Zend
Technologies
2004年7月12日星期一13:11:56 -0700, Jeremy Shovan写道:
On Mon, 12 Jul 2004 13:11:56 -0700, Jeremy Shovan wrote:
我需要做什么才能从cgi-bin运行php
我尝试的一切都给了我一个错误500& 脚本标题的过早结束
它正在虚拟服务器上运行(尝试运行)。文件所有者是与网站管理员相同的uid,并且它被编译为775
对于我尝试过的内容,文件的名称是test.php:
- --test.php ----
#! / usr / bin / php
<?php
echo" test";
?>
----结束--------
和:
---- test.php -------
<?php
echo" test.php" ;;
?> <结束--------
What do I need to do to make php run from the cgi-bin
Everything I try gives me an error 500 "premature End of Script Headers"
It is running (trying to run) on a virtual server. The file owner is the
same uid as the site admin and it is chmoded to 775
The name of the file is test.php for the contents I have tried:
---test.php----
#! /usr/bin/php
<?php
echo "test";
?>
----end--------
and:
----test.php-------
<?php
echo "test.php";
?>
----end--------
我只是做了几个可能错误的猜测:
1)尝试删除pound-bang行中的空格,如下所示:
#!/ usr / bin / php
>
2)尝试在任何其他输出之前输出正确的内容类型。我知道你需要为Perl CGI脚本执行此操作,例如:
echo" Content-type:text / html\\\
\ n" ;;
猜猜。
-
Jeffrey D. Silverman | je*****@pantsjhu.edu **
网站| http://www.newtnotes.com
(**删除裤子通过电子邮件回复)
I am just taking a couple of guesses that may be wrong:
1) try removing the space in the pound-bang line, like so:
#!/usr/bin/php
2) Try outputting the proper content type before any other output. I know
you have to do this for Perl CGI scripts, for example:
echo "Content-type: text/html\n\n";
Just guesses.
--
Jeffrey D. Silverman | je*****@pantsjhu.edu **
Website | http://www.newtnotes.com
(** Drop "pants" to reply by email)
Jeffrey Silverman写道:
Jeffrey Silverman wrote:
On 2004年7月12日星期一13:11:56 -0700,Jeremy Shovan写道:
On Mon, 12 Jul 2004 13:11:56 -0700, Jeremy Shovan wrote:
我需要做些什么才能让php从cgi-bin运行/>
我尝试的所有内容都给出了错误500脚本标题的过早结束
它正在虚拟服务器上运行(尝试运行)。文件所有者是与网站管理员相同的uid,并且它被编译为775
对于我尝试过的内容,文件的名称是test.php:
- --test.php ----
#! / usr / bin / php
<?php
echo" test";
?>
----结束--------
和:
---- test.php -------
<?php
echo" test.php" ;;
?> < ----结束--------
我只是做了几个可能错误的猜测:
1)尝试删除砰砰声中的空间如下:
#!/ usr / bin / php
2)尝试在任何其他输出之前输出正确的内容类型。我知道你必须为Perl CGI脚本执行此操作,例如:
echo" Content-type:text / html\\\
\\\
" ;;
What do I need to do to make php run from the cgi-bin
Everything I try gives me an error 500 "premature End of Script Headers"
It is running (trying to run) on a virtual server. The file owner is the
same uid as the site admin and it is chmoded to 775
The name of the file is test.php for the contents I have tried:
---test.php----
#! /usr/bin/php
<?php
echo "test";
?>
----end--------
and:
----test.php-------
<?php
echo "test.php";
?>
----end--------
I am just taking a couple of guesses that may be wrong:
1) try removing the space in the pound-bang line, like so:
#!/usr/bin/php
2) Try outputting the proper content type before any other output. I know
you have to do this for Perl CGI scripts, for example:
echo "Content-type: text/html\n\n";
^^^^注意这里有2个新行。
个人试图使用php作为cgi而不是直接调用它更多
资源非常密集......
只是猜测。
^^^^ note there are 2 newlines here.
Personnally trying to use php as cgi as opposed to calling it directly is more
resource intensive than it should be...
Just guesses.
-
迈克尔奥斯汀。
顾问 - 可用。
欢迎捐款。 Http://www.firstdbasource.com/donations.html
:)
--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
这篇关于cgi和php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!