简体   繁体   English

从Linux迁移到Windows后的WSOD

[英]WSOD after migrating from Linux to Windows

Originally I had my website locally setup on my laptop which is Linux and had recently migrated my work from there to my main PC - Windows. 最初,我在Linux笔记本电脑上本地设置了网站,最近又将工作从那里迁移到我的主PC-Windows。 My reason for moving my work over is that I found the kind of Linux I am using to be incredibly buggy where the connection would constantly disconnect even though the internet was fine or it would take an incredibly long time to refresh the website. 我转移工作的原因是,我发现我正在使用的那种Linux令人难以置信的bug,即使互联网很好,连接仍会不断断开,或者刷新该网站将花费很长时间。

I am now using XAMPP instead of manually having a localhost with PHP, Apache and MySQL set up. 我现在使用XAMPP,而不是使用PHP,Apache和MySQL手动设置本地主机。 The IDE I am also using now is PhpStorm which is directly connected to my phpmyadmin. 我现在也使用的IDE是PhpStorm,它直接连接到我的phpmyadmin。

Now my problem is that now I get the WSOD - White Screen Of Death, when I, lets say, try to register someone through my website this blank white screen comes up with NO errors displayed and I have looked at every possible help that I could find to fix this. 现在我的问题是,现在我得到了WSOD-死亡白屏,当我说,尝试通过我的网站注册某人时,该空白白屏没有显示任何错误,并且我查看了我所能提供的所有帮助找到解决办法。 Yet no success, so now I'm stuck in limbo as to whether my code is the problem or something else is, I just can't tell. 但是还没有成功,所以现在我无法确定我的代码是问题还是其他问题。

This is the same when I try my login feature as well. 当我尝试登录功能时也是如此。

This worked fine on my laptop, despite the minor errors here and there. 尽管到处都是小错误,但在我的笔记本电脑上仍然可以正常工作。

I have error reporting enabled and I have tried enabling it in the php.ini file which only gets ignored or makes XAMPP reject it (not work). 我启用了错误报告功能,并且尝试在php.ini文件中启用它,该文件只会被忽略或使XAMPP拒绝它(不起作用)。

Here is my code anyways for both the database and registration, just to give an example: 无论如何,这是我的数据库和注册代码,仅举一个例子:

Register.php: Register.php:

<?php

require 'connection.php';

ini_set('display_errors', 1);
ini_set('html_errors', 0);
error_reporting(E_ALL);


$firstname = isset($_POST['firstname']) ? $_POST['firstname'] : '';
$lastname = isset($_POST['lastname']) ? $_POST['lastname'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$confirmpassword = isset($_POST['confirmpassword']) ? $_POST['confirmpassword'] : '';

$message[] = '';

if (!empty($_POST['username']) && !empty($_POST['password']))
{

  //var_dump($password, $confirmpassword);
  if(strlen($password) > 6 && strlen($password) < 32)
  {

    if($password == $confirmpassword)
    {
      $records = $conn->prepare('SELECT * FROM users WHERE Username = :username');
      $records->bindParam(':username', $_POST['username']);
      $records->execute();
      $results = $records->fetchAll(PDO::FETCH_ASSOC);

      //var_dump($results);

      if(count($results) > 0)
      {
        echo 'That username is already in use, please use a different one.';

      }
      else
      {
        $emailRecords = $conn->prepare('SELECT * FROM users WHERE Email = :email');
        $emailRecords->bindParam(':email', $_POST['email']);
        $emailRecords->execute();
        $emailResults = $emailRecords->fetchAll(PDO::FETCH_ASSOC);

        if(count($emailResults) > 0)
        {
          echo 'That email is already in use, are you sure you\'re not registered with us already? <a href="loginPage.php">Login Here</a>';
        }
        else
        {

          $sql = "INSERT INTO users (Firstname, Lastname, Role, Email, Username, Password) VALUES (:firstname, :lastname, :role, :email, :username, :passwords)";
          $stmt = $conn->prepare($sql);
          $hashPassword = password_hash($password, PASSWORD_DEFAULT);

          $stmt->bindParam(':firstname', strip_tags($firstname));
          $stmt->bindParam(':lastname', strip_tags($lastname));
          $stmt->bindParam(':role', $_POST['role']);
          $stmt->bindParam(':email', strip_tags($email));
          $stmt->bindParam(':username',strip_tags($username));
          $stmt->bindParam(':passwords',strip_tags($hashPassword));

          if ($stmt->execute())
          {
            echo 'Well done! You have successfully registered with us!';
            header('Location:loginPage.php');
          }
          else
          {
            echo 'There seems to be an issue getting you registered.';
            //$message = 'There seems to be an issue getting you registered.';
          }
        }
      }
    }
    else
    {
      echo 'Your passwords do not match, please enter them correctly.';
      //$message = 'Your passwords do not match, please enter them correctly.';
      //header('Location:registerPage.php');
    }
}
else
{
  echo 'Your password must be between 6 to 32 characters.';
  //header('Location:registerPage.php');
}
}

Database - Table users: (Required by login and register) 数据库-表用户:(登录和注册所必需)

CREATE TABLE users
(
    id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
    Firstname VARCHAR(50) NOT NULL,
    Lastname VARCHAR(50) NOT NULL,
    Role VARCHAR(30) NOT NULL,
    Email VARCHAR(150) NOT NULL,
    Username VARCHAR(60) NOT NULL,
    Password VARCHAR(128) NOT NULL
);
CREATE UNIQUE INDEX Email ON users (Email);
CREATE UNIQUE INDEX Username ON users (Username);

You are using PhpStorm's own built-in web server, which has some issues right now (especially with POST requests, eg WEB-17317 -- you can watch this ticket (star/vote/comment) to get notified on any progress). 您正在使用PhpStorm自己的内置Web服务器,该服务器目前存在一些问题(尤其是POST请求,例如WEB-17317 ,您可以观看此故障单(星号/投票/评论)以获取有关任何进度的通知)。

The solution is to use your own proper web server (Apache from your XAMPP). 解决方案是使用您自己的适当Web服务器(XAMPP中的Apache)。

  1. Define Deployment entry of appropriate type. 定义适当类型的部署条目。 In place type could be fine, as long as your Apache can serve files from that location; 只要您的Apache可以从该位置提供文件, In place类型就可以了。 otherwise either configure web server to be able to do that .. or use another type of deployment (eg Local or Mounted Folders for IDE to copy files to another location for you). 否则,将Web服务器配置为能够执行此操作..或使用另一种类型的部署(例如,IDE的Local or Mounted Folders将文件复制到您的其他位置)。
  2. Configure it (provide desired URL etc) -- make sure it shows no warnings about unfilled fields on first 2 tabs. 配置它(提供所需的URL等)-确保它在前两个选项卡上没有显示有关未填写字段的警告。
  3. Mark it as Default for this project. 将此项目标记为默认。

Now IDE will use that base URL when you will use Open in Browser or Run/Debug actions (NOTE: it will not affect any existing Run/Debug Configurations -- only future ones; you will have to update your current Run/Debug Configurations manually). 现在,当您使用“ Open in Browser或“运行/调试”操作时,IDE将使用该基本URL(注意:它将不影响任何现有的运行/调试配置-仅影响以后的配置;您将必须手动更新当前的“运行/调试配置” )。


What's the difference between the two: https://stackoverflow.com/a/33598214/783119 两者之间有什么区别: https : //stackoverflow.com/a/33598214/783119

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将Drupal站点从Windows迁移到Linux计算机 - Migrating drupal site from a Windows to a Linux machine 将旧版PHP项目从Windows迁移到Linux(不一致的案例灾难) - Migrating a legacy PHP Project from Windows to Linux (inconsistent case disaster) Codeigniter和Doctrine的问题,从Windows迁移到Linux服务器 - Problem with Codeigniter and Doctrine, migrating from Windows to Linux server PHP包括:将Web应用程序从Windows迁移到Linux时出现错误500 - PHP Include : Error 500 when migrating web application from Windows to Linux 将 PHP 项目从 Linux 服务器迁移到 Windows 服务器时,文件名中的斜线 - Slashes in file names when migrating PHP project to Windows server from Linux server 从Windows到Linux传输zend项目后路由错误 - Route error after transfer zend projects from Windows to Linux 将WordPress多站点从Windows迁移到Linux后的高TTFB - High TTFB after moving WordPress multisite from Windows to Linux 在Wsod上显示错误,但在成功重定向后无法显示内容 - Error Displaying On Wsod Yet Failing To Display Contents After Successful Redirect 从 Mysql 迁移到 MariaDb 后出错 - Error after migrating from Mysql to MariaDb 迁移到Windows计算机后,PHP App无法正常工作 - PHP App doesn't work after migrating to a Windows machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM