作者meemily (好犹豫喔)
看板PHP
标题[请益] 安装ok 执行有很多警告
时间Tue May 13 17:07:46 2008
我是用iis(第几版不知道,我是家用版去改装的)+mysql 5.0.51a-win32
+php-5[1].2.1-win32安装成功的
我也有去php.ini里面做必要的修改
然後我有用phpinfo()去测 跑得出来
可是跑程式就怪怪的了 以下第一个测试是小怪
(程式码如下:
<?php
header('content-type: text/html; charset=utf-8');
echo '1 到 100 之间所有 3 的倍数:<br />';
$i = 1;
//teacher added
$sum = 0;
while ($i <=100) {
if(($i % 3) == 0) { // 除以 3 余数为 0, 即为 3 的倍数
echo $i . ' '; // 输出 $i 的值
$sum += $i; // 将 $i 值累加至 $sum
}
$i++;
}
echo '<br />上列所有数值的总和为:' . $sum;
?>
它执行出来的结果是还可以看的 只是後面警告很奇怪
1 到 100 之间所有 3 的倍数:
3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81
84 87 90 93 96 99
上列所有数值的总和为:1683PHP Warning: PHP Startup: Unable to initialize
module Module compiled with module API=20020429, debug=0, thread-safety=1 PHP
compiled with module API=20060613, debug=0, thread-safety=1 These options
need to match in Unknown on line 0 PHP Warning: PHP Startup: ?? Unable to
initialize module Module compiled with module API=20020429, debug=0,
thread-safety=1 PHP compiled with module API=20060613, debug=0,
thread-safety=1 These options need to match in Unknown on line 0 PHP Warning:
PHP Startup:: Unable to initialize module Module compiled with module API=20020429,
debug=0, thread-safety=1 PHP compiled with module API=20060613, debug=0,
thread-safety=1 These options need to match in Unknown on line 0
上面这些文字 好像是说什麽不能初始化的感觉...我也不怎麽懂
第二个是超怪的测试 如下:
(程式码:
<html>
<head>
<meta http-equiv="Content-Type"content="text/html;charset=utf-8"/>
</head>
<body>
<form method="post">
<!-- 单列文字输入栏位 -->
帐号:
<input type="text" name="username" /> <br />
<!-- 密码输入栏位 -->
密码:
<input type="password" name="passwd" /> <br />
<!-- 登入与清除资料的按钮 -->
<input type="submit" value="登入" />
<input type="reset" value="清除" />
</form>
<?php
<!--if判断开始 --> //第二十四行
if ( ($_post['username']== 'test1') && ($_post['passwd']=='pwd1') ){
echo "hw1-1.php";
}else if ( ($_post['username']== 'test2') &&
($_post['passwd']=='pwd2') ){
echo "hw1-1.php";
}else{
echo "hw1-3.php";
}
?>
</body>
</html>
它的结果如下:
PHP Warning: PHP Startup: Unable to initialize module Module compiled with
module API=20020429, debug=0, thread-safety=1 PHP compiled with module
API=20060613, debug=0, thread-safety=1 These options need to match in Unknown
on line 0 PHP Warning: PHP Startup: ?? Unable to initialize module Module
compiled with module API=20020429, debug=0, thread-safety=1 PHP compiled with
module API=20060613, debug=0, thread-safety=1 These options need to match in
Unknown on line 0 PHP Warning: PHP Startup: Unable to initialize module Module compiled with module API=20020429,
debug=0, thread-safety=1 PHP compiled with module API=20060613, debug=0,
thread-safety=1 These options need to match in Unknown on line 0 PHP Parse
error: syntax error, unexpected '<' in C:\Inetpub\wwwroot\hw1-1.php on line 24
感觉连程式码都有错的样子
我不知道是不是安装出了什麽错误(可是安装下来他都没说有错误)
谢谢大家
--
http://class.ruten.com.tw/user/index00.php?s=emily4531189
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.81.232.198
※ 编辑: meemily 来自: 219.81.232.198 (05/13 17:15)
※ 编辑: meemily 来自: 219.81.232.198 (05/13 17:19)
1F:推 arrack:warning可以不用理他,懒得处理 就改成2037吧 05/13 17:18
2F:→ meemily:可是第二个程式就跑不出来了 05/13 17:21
3F:推 arrack:最後一个是程式码错误,可是之前的不是....是某个模组 没렠 05/13 17:22
4F:→ meemily:是if不可以用两个小括号错的吗? 想说c可以用 不知道php可 05/13 17:24
5F:→ meemily:不可以用两个小括号 05/13 17:24
6F:推 arrack: <!--if判断开始 --> //第二十四行 05/13 17:25
7F:→ arrack:那是html 注解 PHP 只支援 // 跟/* */ 05/13 17:25
8F:→ meemily:哦~原来如此 谢谢a大大 05/13 17:26
9F:→ arrack:把他移到<?PHP 上方 或是拿掉 05/13 17:26