2016-04-19 2 views
0

Я создал простую регистрационную форму PHP и загрузил ее в VIA FTP в свой лазурный каталог. Когда я заполняю свои данные формы и нажимаю «Отправить», он автоматически переходит на страницу с ошибкой 500. У них нет ошибок в моем скрипте, поэтому мне это не имеет смысла.Azure PHP Ошибка 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> 
+0

может быть чем-то простым, как синтаксическая ошибка в скрипте или выдается предупреждение. вам нужно будет просмотреть журналы ошибок для получения подробной информации. –

+0

@MarcB Я разместил журнал ошибок – Kevin

+0

ну, там ничего полезного нет. вам придется начинать рыть. –

ответ

2

Включить ошибки отображения, для получения подробной информации об ошибке и, следовательно, более простой отладки. Поместите эту строку кода в верхней части вашего PHP скрипт:

ini_set('display_errors', 1); 

Затем обновите свой вопрос с новой ошибкой.

+0

Спасибо, человек! Я добавил, что и ошибка возникла, когда указала неопределенную функцию password_hash, пароль hash пришел в php версии 5.5. Я проверил мою азбучную PHP-версию и был установлен в 5.4. Я обновил версию PHP до 5.5 и VIOLA! Оно работает. Еще раз спасибо! Я буду принимать этот ответ, как только он позволит мне – Kevin

+0

Простые вещи, мой друг, это потрясающе, что это не автоматическое включение для тех, кто действительно начинает PHP. Рад, что ты заработал! – Tommy

Смежные вопросы