502 Bad Gateway
PhpStorm 10.0.1
我是在学习“上传文件”一课时遇到的,用Google Chrome浏览器 windows平台,本来正常输出 echo啥的没问题,一执行“上传图片” 就出现,而且之后的所有php 还是 HTML 运行起来就是都这样,重启就又好了,但上传就不行。偶尔错误提示是404 bad Gateway。请大家指教!!感激不尽!!眼泪哗哗的!!
代码:
HTML:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>上传文件</title> </head> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="myFile"> <input type="submit" value="提交"> </form> </body> </html>
php:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>The Image</title> </head> <body> <?php $file=$_FILES['myFile']; $fileName=$file['name']; move_uploaded_file($file['tmp_name'],$fileName); echo "<img src='$fileName' alt="为什么 用xampp经常会出现“502 Bad Gateway ”提示?" >"; ?> </body> </html>
502 Bad Gateway
PhpStorm 10.0.1
我是在学习“上传文件”一课时遇到的,用Google Chrome浏览器 windows平台,本来正常输出 echo啥的没问题,一执行“上传图片” 就出现,而且之后的所有php 还是 HTML 运行起来就是都这样,重启就又好了,但上传就不行。偶尔错误提示是404 bad Gateway。请大家指教!!感激不尽!!眼泪哗哗的!!
代码:
HTML:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>上传文件</title> </head> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="myFile"> <input type="submit" value="提交"> </form> </body> </html>
php:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>The Image</title> </head> <body> <?php $file=$_FILES['myFile']; $fileName=$file['name']; move_uploaded_file($file['tmp_name'],$fileName); echo "<img src='$fileName' alt="为什么 用xampp经常会出现“502 Bad Gateway ”提示?" >"; ?> </body> </html>