[請益] 安裝ok 執行有很多警告

看板PHP作者 (好猶豫喔)時間17年前 (2008/05/13 17:07), 編輯推噓3(306)
留言9則, 2人參與, 最新討論串1/1
我是用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)

05/13 17:18, , 1F
warning可以不用理他,懶得處理 就改成2037吧
05/13 17:18, 1F

05/13 17:21, , 2F
可是第二個程式就跑不出來了
05/13 17:21, 2F

05/13 17:22, , 3F
最後一個是程式碼錯誤,可是之前的不是....是某個模組 沒렠
05/13 17:22, 3F

05/13 17:24, , 4F
是if不可以用兩個小括號錯的嗎? 想說c可以用 不知道php可
05/13 17:24, 4F

05/13 17:24, , 5F
不可以用兩個小括號
05/13 17:24, 5F

05/13 17:25, , 6F
<!--if判斷開始 --> //第二十四行
05/13 17:25, 6F

05/13 17:25, , 7F
那是html 註解 PHP 只支援 // 跟/* */
05/13 17:25, 7F

05/13 17:26, , 8F
哦~原來如此 謝謝a大大
05/13 17:26, 8F

05/13 17:26, , 9F
把他移到<?PHP 上方 或是拿掉
05/13 17:26, 9F
文章代碼(AID): #18ALfas0 (PHP)
文章代碼(AID): #18ALfas0 (PHP)