enter image description here我在我的 Windows Localhost XAMPP 上做了一个 PHP 项目。现在我想在 Apache2.4 上的公司 Linux 服务器上启动它,但是这个 Apache 以某种方式处理数组部分 (=>) 作为 php
的结束标记。如何解决这个问题?
感谢您提前申请!
<?php
$error = "";
if(isset($_POST['username'],$_POST['password'])){
$user = array('usern' =>'xxx',"passw"=>"yyy",);
$username = $_POST['username'];
$pass = $_POST['password'];
if($username == $user['usern'] && $pass == $user['passw']){
session_start();
$_SESSION['simple_login'] = $username;
echo '{"error":0}';
}else{
echo '{"error":1}';
}
exit();
}
?>
最佳答案
你怎么描述的,好像是把代码解释成了html。
很可能是 web 服务器上没有安装用于 apache 的 php 模块。
关于php - Apache 处理 PHP 数组标记作为结束标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57108336/