当用户网站无法运行CGI程序时,您可以使用以下语句检测服务器端的CGI功能是否正常。
CGI测试(test.cgi)
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "hello world!!!";
exit
将以上语句保存为.cgi文件(如:test.cgi),并
上传到网站中直接浏览。如可以正常浏览,则服务器端的CGI功能正常。 php 测试主机的PHP版本,同时也可以检测服务器端的PHP功能是否正常。 几个php测试脚本 ##脚本1 helloword.php
First program <?php echo "hello, world\n"; ?> ##脚本2 phpinfo.php phpinfo(); ?> ##脚本3 连接mysql mysql.php $conn=mysql_connect("localhost","root","111111"); if ($conn) { echo "Mysql Connect Successfully!"; } else { echo "Mysql Connect Failed!"; } ?> 将以上语句保存为.php文件,并上传到网站中直接浏览。如可以正常浏览,则服务器端的php功能正常。