【问题标题】:500 Internal Server Error WAMP PhpStorm500 内部服务器错误 WAMP PhpStorm
【发布时间】:2015-11-02 19:38:18
【问题描述】:

我目前正在使用 WAMP 在 PhpStorm 中开发一个 PHP 项目。

当我运行我的项目时,我收到“500 内部服务器错误”。当我对项目中的某个 php 文件进行代码更改时,会显示此错误。例如,我在 html 输入标签中添加了一个名称属性,这导致了“500 内部服务器错误”。

有人可以就这个错误提出建议吗?

<?php
    require_once 'databaseLoginCredentials.php';
    $connection = new mysqli($db_hostname, $db_username, $db_password, $db_name);
    if ($connection->connect_error)
    {
        die("Connection failed " . $connection->connect_error);
    }
    $sql = ("SELECT * FROM tbl_patientdetails pd INNER JOIN tbl_doctors dr ON pd.pd_registerDoctorId = dr.dr_Id");
    $result = $connection->query($sql);
    if ($result->num_rows > 0 ) {
        while ($row = $result->fetch_object())
        {
            echo '<tr>';
            echo '<td><button name="btn-edit" id="btn-edit" value="Edit" onclick="populatePatientDetailsForm()">' . 'Edit' .'</button></td>';
            echo '<td><button name="btn-delete" id="btn-delete" value="Delete" onclick="">' . 'Delete' .'</button></td>';
            echo '<td>' . $row->pd_id . '</td>';
            echo '<td>' . $row->pd_forename . '</td>';
            echo '<td>' . $row->pd_lastname . '</td>';
            echo '<td>' . $row->pd_dateOfBirth . '</td>';
            echo '<td>' . $row->pd_gender . '</td>';
            echo '<td>' . $row->dr_id . '</td>';
            echo '<td>' . $row->pd_address . ' </td>';
            echo '<td>' . $row->pd_postcode . '</td>';
            echo '<td>' . $row->pd_phoneNumber .'</td>';
            echo '<td>' . $row->pd_email .'</td>';
            echo '</tr>';
        }
    } else
    {
        echo "0 Patients Returned";
    }
    $connection->close();
    ?> <!--END OF PHP-->

require_once 'databaseLoginCredentials.php';

if ($_POST['btn-submit']) {

    $id = $_POST['txt-patientId'];
    $forename = $_POST['txt-forename'];
    $surname = $_POST['txt-surname'];
    $dateOfBirth = $_POST['txt-dateOfBirth'];
    $gender = $_POST['ddl-gender'];
    $doctorId = $_POST['ddl-doctor'];
    $address = $_POST['txt-address'];
    $postcode = $_POST['txt-postcode'];
    $phoneNumeber = $_POST['txt-phoneNumber'];
    $email = $_POST['txt-email'];


    $conn = new mysqli($db_hostname, $db_username, $db_password, $db_name);

    if ($conn->connect_error) {
        die("Connection failed: (" . $conn->connect_error);
    }

    $sql = ("Update tbl_patientdetails
            SET pd_forename = '$forename',
                pd_lastname = '$surname',
                pd_dateOfBirth = '$dateOfBirth',
                pd_gender = '$gender',
                pd_registerDoctorId = '$doctorId',
                pd_address = '$address',
                pd_postcode = '$postcode',
                pd_phoneNumber = '$phoneNumeber',
                pd_email = '$email',
            WHERE pd_id = '$id'");

    if ($conn->query($sql) === TRUE) {

        echo "Success: ' .$id' ',' ' .$forename' Please redirect me Joe";
    } else {
        echo " error Joe: " . $conn->error;
        //Return to patiend Details page
    }

    $conn->close();
}

WAMP ERROR

【问题讨论】:

  • 你能提供你的 php 吗?
  • 您需要发布更多详细信息。您应该在 apache 错误日志中找到更详细的错误。另外,发布你的 php。
  • @BrianKeller-Heikkila 已添加。您能建议如何访问 apache 错误日志吗?
  • @Nirnae PHP sn-ps 现已添加,谢谢。
  • 张贴外部链接的 PHP 代码图像对可能遇到您问题的其他人没有帮助。直接在问题中发布 PHP 代码。查看how to ask a question。至于访问 apache 错误日志,我不熟悉 WAMP 设置,但我相信你可以很容易地用谷歌搜索它。

标签: php wamp internal-server-error


【解决方案1】:

原来“SQL 服务器报告服务”阻塞了端口 80。我已禁用该服务,现在 WAMP 运行良好(绿色)。我不确定这是唯一的问题...

【讨论】:

    猜你喜欢
    • 2012-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-15
    • 2018-08-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多