Azure PHP错误500

时间:2016-04-19 15:28:59

标签: php mysql azure

我创建了一个简单的PHP寄存器表单并将其上传到我的azure目录。 当我填写表单详细信息并单击“提交”时,它会自动转到错误500页。它们在我的剧本中没有错误,所以这对我没有意义。

我确保登录已开启,当我阅读错误报告时,这就是它所说的。

HTTP Error 500.0 - Internal Server Error

The page cannot be displayed because an internal server error has occurred.



Most likely causes:
•IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
•IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
•IIS was not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL.
•The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Things you can try:
•Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
•Check the event logs to see if any additional information was logged.
•Verify the permissions for the DLL.
•Install the .NET Extensibility feature if the request is mapped to a managed handler.
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here. 



Detailed Error Information:



Module
   FastCgiModule 

Notification
   ExecuteRequestHandler 

Handler
   PHP54_via_FastCGI 

Error Code
   0x00000000 



Requested URL
   http://MyTestSite:80/register.php 

Physical Path
   D:\home\site\wwwroot\register.php 

Logon Method
   Anonymous 

Logon User
   Anonymous 
#

这是我的实际代码。

<?php
    require_once 'processor/dbconfig.php';



    if(isset($_POST['submit']))
    {
       $uname = trim($_POST['user']);
       $umail = trim($_POST['email']);
       $upass = trim($_POST['pwd']); 
       $fname = trim($_POST['first']); 
       $lname = trim($_POST['last']); 
       $ubranch = trim($_POST['branch']); 


                if($user->register($fname,$lname,$uname,$umail,$upass,$ubranch)) 
                {
                    echo 'Success';
                }


    }
    ?>
    <html>
    <head>
          <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- jQuery library -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

    <!-- Latest compiled JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <style type="text/css">
        .container {
            margin-right: auto;
            margin-left: auto;
            margin-top: 15px;
            margin-bottom: auto;
            width: 200px;
            clear: both;
            padding: 20px 50px 20px;
            width: 400px;
            background: white;
            border-radius: 3px;
            -webkit-box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
            box-shadow: 0 0 200px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
        }
    </style>
    </head>
    <body>
    <div class="container">
    <form role="form" method="POST">

      <div class="form-group">
        <label for="user">Username:</label>
        <input type="text" name="user" class="form-control" id="user">
      </div>
      <div class="form-group">
        <label for="pwd">Password:</label>
        <input type="password" name="pwd" class="form-control" id="pwd">
      </div>
      <div class="form-group">
        <label for="email">Email:</label>
        <input type="email" name="email" class="form-control" id="email">
      </div>
      <div class="form-group">
        <label for="first">First Name:</label>
        <input type="text" name="first" class="form-control" id="first">
      </div>
      <div class="form-group">
        <label for="last">Last Name:</label>
        <input type="text" name="last" class="form-control" id="last">
      </div>
      <div class="form-group">
        <label for="branch">Branch:</label>
        <input type="text" name="branch" class="form-control" id="branch">
      </div>
      <input type="submit" name="submit" class="btn btn-default"/>
    </form>
    </div>
    </body>
    </html>

1 个答案:

答案 0 :(得分:2)

启用显示错误,以获取详细错误,从而更轻松地进行调试。 将这行代码放在PHP脚本的顶部:

ini_set('display_errors', 1);

然后使用新错误更新您的问题。