Home > Backend Development > PHP Tutorial > 为什么 用xampp经常会出现“502 Bad Gateway ”提示?

为什么 用xampp经常会出现“502 Bad Gateway ”提示?

WBOY
Release: 2016-06-06 20:23:45
Original
1582 people have browsed it

502 Bad Gateway

PhpStorm 10.0.1

我是在学习“上传文件”一课时遇到的,用Google Chrome浏览器 windows平台,本来正常输出 echo啥的没问题,一执行“上传图片” 就出现,而且之后的所有php 还是 HTML 运行起来就是都这样,重启就又好了,但上传就不行。偶尔错误提示是404 bad Gateway。请大家指教!!感激不尽!!眼泪哗哗的!!

代码:

HTML:

<code class="html">


    <meta charset="UTF-8">
    <title>上传文件</title>


<form action="upload.php" method="post" enctype="multipart/form-data">
    <input type="file" name="myFile">
    <input type="submit" value="提交">
</form>

</code>
Copy after login
Copy after login

php:

<code class="php">


    <meta charset="UTF-8">
    <title>The Image</title>


<?php $file=$_FILES['myFile'];
$fileName=$file['name'];
move_uploaded_file($file['tmp_name'],$fileName);

echo "<img  src='$fileName' alt="为什么 用xampp经常会出现“502 Bad Gateway  ”提示?" >";
?>

</code>
Copy after login
Copy after login

回复内容:

502 Bad Gateway

PhpStorm 10.0.1

我是在学习“上传文件”一课时遇到的,用Google Chrome浏览器 windows平台,本来正常输出 echo啥的没问题,一执行“上传图片” 就出现,而且之后的所有php 还是 HTML 运行起来就是都这样,重启就又好了,但上传就不行。偶尔错误提示是404 bad Gateway。请大家指教!!感激不尽!!眼泪哗哗的!!

代码:

HTML:

<code class="html">


    <meta charset="UTF-8">
    <title>上传文件</title>


<form action="upload.php" method="post" enctype="multipart/form-data">
    <input type="file" name="myFile">
    <input type="submit" value="提交">
</form>

</code>
Copy after login
Copy after login

php:

<code class="php">


    <meta charset="UTF-8">
    <title>The Image</title>


<?php $file=$_FILES['myFile'];
$fileName=$file['name'];
move_uploaded_file($file['tmp_name'],$fileName);

echo "<img  src='$fileName' alt="为什么 用xampp经常会出现“502 Bad Gateway  ”提示?" >";
?>

</code>
Copy after login
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template