【发布时间】:2019-05-22 09:36:45
【问题描述】:
我写了一个简单的 PHP 脚本来运行 XAMPP:
<?php
echo "hi";
?>
脚本在 htdocs 中,如 test.php,XAMPP 对 Apache 和 MySQL 有绿灯,两个本地主机都有绿灯。另外,我在volumes下按下了mount。
但是,当我将http://localhost:8080/test.php 输入浏览器时,显示的只是这些乱码:
bookmark88P��������Ap4UsersMady Documentstest.php ,@7�G^H^��hx��A���%���� file:///Macintosh HD`3A�ݨ�$575888D7-ADD6-32F5-908D-0B9414CCE3C2���/NSURLDocumentIdentifierKeyB3dnibphp????����P��@�T�UV� � , < p P ` �0 ��� � ��@"�����
我应该采取什么步骤来解决这个问题?谢谢!
【问题讨论】:
-
不确定它是否适用于 MAC,但您是否运行了 xampp 设置脚本?另外,您的php文件是什么编码?以及什么本机系统编码?
-
(题外话)这个问题让我想到了xkcd: Types of Editors...
标签: php apache xampp localhost runtime-error