我检查了我的php.ini文件,并设置了显示错误,还有错误报告display_errors.我重新启动了我的Apache Web服务器.
我甚至把这些行放在我的脚本的顶部,它甚至没有捕获简单的解析错误.例如,我使用a声明变量,E_ALL而不是关闭语句"$".但是我的所有脚本都显示这些错误的空白页面,但我想在浏览器输出中看到错误.
error_reporting(E_ALL);
ini_set('display_errors', 1);
Run Code Online (Sandbox Code Playgroud)
还剩下什么?
我有一个HTML文件,其中包含许多JUST"li"标签,没有头部和身体标签以及其他任何东西.我想用PHP计算它们.我怎样才能做到这一点?
但是,我试过这个:
$dom = new DOMDocument();
DOMDocument::loadHTML($tmp_file);
$count = $dom->getElementsByTagName("li");
echo count($count);
Run Code Online (Sandbox Code Playgroud)
但它返回1.
这是$ tmp_file(我不知道它们将被检索多少(可能是其中的一百个)但我只是将其中的5个添加到这里):
<li >
<a target="_blank" class="small-news-link" href="http://www.varzesh3.com/news/1426832/????????-?????-??????-???-???????-?????-??" target="_blank" title="???????? ????? ?????? ??? ??????? ????? ??">???????? ????? ?????? ??? ??????? ????? ??</a>
</li>
<li >
<a target="_blank" class="small-news-link" href="http://www.varzesh3.com/news/1426824/????-??-???-??????-?????-???-???-??-?????" target="_blank" title="????: ?? ??? ?????? ????? ??? ??? ?? ?????">????: ?? ??? ?????? ????? ??? ??? ?? ?????</a>
</li>
<li >
<a target="_blank" class="small-news-link" href="http://www.varzesh3.com/news/1426817/????-???-«???»-???????-?????-?????-?????-????" target="_blank" title="???? ??? «???» ??????? ????? ????? ????? ????">???? ??? «???» ??????? ????? …Run Code Online (Sandbox Code Playgroud) 当我运行phpMyAdmin并单击“导出/导入”时,总是出现错误:
处理请求时出错错误代码:500错误文本:Internal Server Error。操作系统-Ubuntu 18.04
当我点击索引页而不是错误消息时,我只是得到一个空白页面.有没有办法显示PHP错误消息?当我得不到任何反馈时,很难调试.我的环境是linux.PHP
我有这个PHP文件存储在服务器上.它为数据库创建了一个新用户.注册成功但响应消息始终为NULL.
这是我的register.php文件,其中我发布了值
<?php
require_once 'DB_Functions.php';
$db = new DB_Functions();
// json response array
$response = array("error" => FALSE);
if (($_POST['name']) && ($_POST['surname']) && ($_POST['email']) && ($_POST['password']) && ($_POST['telephone'] && ($_POST['country']) ) )
{
// receiving the post params
$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$password = $_POST['password'];
$telephone = $_POST['telephone'];
$country = $_POST['country'];
// check if user is already existed with the same email
if ($db->isOwnerExisted($email)) {
// user already existed
$response["error"] = TRUE;
$response["error_msg"] = "User …Run Code Online (Sandbox Code Playgroud)