简体   繁体   中英

Azure PHP Error 500

I have created a simple PHP register form and uploaded it VIA FTP to my azure directory. When I fill out my form details and click submit it automatically goes to error 500 page. Their are no errors in my script so this makes no sense to me.

I made sure Logging was on and when I read the error report this is what it said.

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 
#

And this is my actual code.

<?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>

Enable Display errors, for a detailed error, and thus an easier debug. Put this line of code at the top of your PHP script:

ini_set('display_errors', 1);

Then update your question with the new error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM