[請益] 請問為何修改了httpd.conf仍無法執行php?
如題,我使用 Wamp 版本為:
Apache Version :2.4.9
PHP Version :5.5.12
MySQL Version :5.6.17
目前狀況是php碼不會被執行,browser直接跑出部分原始碼,html部分正常。
已嘗試:
-開啟apache;把skype port 80 選項關閉
-修改httpd.conf:
1. AllowOverride none 改為 All
2. PHPIniDir c:/wamp/bin/php/php5.5.12 確認路徑檔案無誤
3. #LoadModule php5_module "c:/wamp/bin/php/php5.5.12/php5apache2_4.dll"
最前面#號拿掉
4. 有下面這兩行:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
是否為source code哪邊有問題呢??
請參考下面 travellers.html 和 travellers.php 兩個檔:
(在同一個資料夾下)
感謝指教~~!!
===================================================================
其中travellers.html 表單部分設定為
<form method="POST" action="travellers.php">
...
</form>
===================================================================
而travellers.php 詳細原始碼如下:
<!doctype html>
<html>
<head>
<title>Response of travellers Report</title>
</head>
<body>
<h2>You have reported successfully!!</h2>
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$place = $_POST['place'];
$budget = $_POST['budget'];
$exp = $_POST['exp'];
$to = 'xxxxxxxx@gmail.com';
$subject = "Response of $name 's Report";
$msg = "Your name is : $name.\n" .
"E-mail address : $email\n" .
"Place : $place\n" .
"Budget: $budget\n" .
"First trip ? $exp";
mail($to, $subject, $msg, 'From:' . $email);
echo 'Thanks for your response.<br />';
echo 'Your name is ' . $name . '<br />';
echo 'Your e-mail is ' . $email . '<br />';
echo 'Your travelling place is ' . $place . '<br />';
echo 'Your budget is ' . $budget . '<br />';
echo 'First time for travelling abroad?' . $exp '<br />';
?>
</body>
</html>
====================================================================
再次感謝~~!! :))))
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.161.115.177
※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1462788657.A.957.html
→
05/09 18:31, , 1F
05/09 18:31, 1F
→
05/09 18:32, , 2F
05/09 18:32, 2F
→
05/09 18:32, , 3F
05/09 18:32, 3F
→
05/09 18:32, , 4F
05/09 18:32, 4F
→
05/09 19:28, , 5F
05/09 19:28, 5F
→
05/09 19:33, , 6F
05/09 19:33, 6F
→
05/09 19:36, , 7F
05/09 19:36, 7F
→
05/09 19:36, , 8F
05/09 19:36, 8F
→
05/09 19:39, , 9F
05/09 19:39, 9F
推
05/09 22:13, , 10F
05/09 22:13, 10F
→
05/09 22:13, , 11F
05/09 22:13, 11F
→
05/09 22:13, , 12F
05/09 22:13, 12F
推
05/09 22:15, , 13F
05/09 22:15, 13F
→
05/09 22:35, , 14F
05/09 22:35, 14F
→
05/09 22:36, , 15F
05/09 22:36, 15F
→
05/09 22:43, , 16F
05/09 22:43, 16F
推
05/09 22:44, , 17F
05/09 22:44, 17F
→
05/09 22:45, , 18F
05/09 22:45, 18F
→
05/09 22:48, , 19F
05/09 22:48, 19F
→
05/09 22:48, , 20F
05/09 22:48, 20F
→
05/09 22:50, , 21F
05/09 22:50, 21F
推
05/10 00:06, , 22F
05/10 00:06, 22F
→
05/10 00:07, , 23F
05/10 00:07, 23F
→
05/10 00:07, , 24F
05/10 00:07, 24F
→
05/10 00:27, , 25F
05/10 00:27, 25F
噓
05/12 00:52, , 26F
05/12 00:52, 26F
推
05/12 01:28, , 27F
05/12 01:28, 27F
→
05/12 01:31, , 28F
05/12 01:31, 28F
→
05/12 01:32, , 29F
05/12 01:32, 29F
→
05/12 01:33, , 30F
05/12 01:33, 30F
→
05/12 10:42, , 31F
05/12 10:42, 31F
→
05/12 10:42, , 32F
05/12 10:42, 32F
→
05/12 10:43, , 33F
05/12 10:43, 33F
推
05/12 11:23, , 34F
05/12 11:23, 34F
推
05/12 17:34, , 35F
05/12 17:34, 35F
→
05/12 17:34, , 36F
05/12 17:34, 36F
→
05/12 17:35, , 37F
05/12 17:35, 37F
→
05/12 17:35, , 38F
05/12 17:35, 38F
→
05/12 17:37, , 39F
05/12 17:37, 39F
→
05/12 17:37, , 40F
05/12 17:37, 40F
→
05/12 17:37, , 41F
05/12 17:37, 41F
推
05/12 18:22, , 42F
05/12 18:22, 42F
推
05/12 19:01, , 43F
05/12 19:01, 43F
推
05/12 23:24, , 44F
05/12 23:24, 44F
→
05/13 09:43, , 45F
05/13 09:43, 45F
→
05/13 09:44, , 46F
05/13 09:44, 46F
→
05/13 09:44, , 47F
05/13 09:44, 47F
推
05/13 09:58, , 48F
05/13 09:58, 48F
→
05/13 09:59, , 49F
05/13 09:59, 49F
→
05/13 09:59, , 50F
05/13 09:59, 50F
推
05/13 10:02, , 51F
05/13 10:02, 51F
推
05/13 10:02, , 52F
05/13 10:02, 52F
→
05/13 10:02, , 53F
05/13 10:02, 53F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章