Home Backend Development PHP Tutorial die 揭示的消息都去哪了

die 揭示的消息都去哪了

Jun 13, 2016 am 11:55 AM
fopen nbsp txt

die 提示的消息都去哪了?

小弟新手:


              $fp=fopen("./readme.txt","r") or die("不能打开该文件");


想问下,如果打开失败,那么die 的这条消息输出到哪了啊?貌似打开失败界面也没有直接弹出这条消息?请问使用die这条消息自动会从服务器发到终端,然后在界面中弹出?
------解决方案--------------------
直接输出到浏览器
------解决方案--------------------
直接运行下面的code看看能不能输出123,如果可以,你就是fopen那个是正常的。

<br /><?php<br />die('123');<br />?><br />
Copy after login

die等于 echo xxx 然后 停止页面。

<br /><?php<br />$fp=fopen('','r') or die('123'); // 没有文件名,不可能打开,回转到die执行<br />?><br />
Copy after login

------解决方案--------------------

先不用ajax,直接用php看看能否輸出。如果可以,那問題就可以定位在js部分了。
------解决方案--------------------

引用:
$fp = fopen("./readme.txt","r") or die("不能打开该文件");
如果是 页面没有反应
那么可能有两种情况:
1、readme.txt 文件存在,并可以被打开。自然也就不会用显示了
2、readme.txt 不存在,php 的错误显示功能也没有打开
这下就悲催了,fopen 失败时的错误信息:Warning: fopen(./readme.txt): failed to open stream: No such file or directory in .....
无处可去,活生生的把 php 给憋死了

错误显示功能没有打开不影响这个显示,反而打开了错误显示,会先显示PHP的出错信息,然后才是这个die出来的不能打开文件的提示。
[email protected],[email protected]?信息。
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solution: Your organization requires you to change your PIN Solution: Your organization requires you to change your PIN Oct 04, 2023 pm 05:45 PM

Solution: Your organization requires you to change your PIN

How to adjust window border settings on Windows 11: Change color and size How to adjust window border settings on Windows 11: Change color and size Sep 22, 2023 am 11:37 AM

How to adjust window border settings on Windows 11: Change color and size

How to change title bar color on Windows 11? How to change title bar color on Windows 11? Sep 14, 2023 pm 03:33 PM

How to change title bar color on Windows 11?

OOBELANGUAGE Error Problems in Windows 11/10 Repair OOBELANGUAGE Error Problems in Windows 11/10 Repair Jul 16, 2023 pm 03:29 PM

OOBELANGUAGE Error Problems in Windows 11/10 Repair

How to enable or disable taskbar thumbnail previews on Windows 11 How to enable or disable taskbar thumbnail previews on Windows 11 Sep 15, 2023 pm 03:57 PM

How to enable or disable taskbar thumbnail previews on Windows 11

Display scaling guide on Windows 11 Display scaling guide on Windows 11 Sep 19, 2023 pm 06:45 PM

Display scaling guide on Windows 11

10 Ways to Adjust Brightness on Windows 11 10 Ways to Adjust Brightness on Windows 11 Dec 18, 2023 pm 02:21 PM

10 Ways to Adjust Brightness on Windows 11

How to turn off private browsing authentication for iPhone in Safari? How to turn off private browsing authentication for iPhone in Safari? Nov 29, 2023 pm 11:21 PM

How to turn off private browsing authentication for iPhone in Safari?

See all articles