- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个主页正确显示的网站,但是当我点击子页面时出现以下错误:
警告:require_once(../php/DB.php) [function.require-once]:无法打开流:第 75 行/home/user/public_html/config.php 中没有这样的文件或目录
fatal error :require_once() [function.require]: Failed opening required '../php/DB.php' (include_path='.:/home/content/74/9419674/html/PEAR/PEAR')在/home/user/public_html/config.php 第 75 行
我在主页上收到此错误,但能够追踪到源头并更正链接。我假设它没有正确读取链接,但我已经把头撞在墙上足够长的时间了。
配置文件:
require_once '../php/DB.php';
$dsn = 'mysql://username:password@host/database';
$options = array(
'debug' => 2,
'portability' => DB_PORTABILITY_ALL,
);
$db =& DB::connect($dsn, $options);
$db->setOption('autofree', true);
$db->setOption('persistent', true);
$db->setFetchMode(DB_FETCHMODE_ASSOC);
if (PEAR::isError($db)) {
echo 'Standard Message: ' . $db->getMessage() . "\n";
echo 'Standard Code: ' . $db->getCode() . "\n";
echo 'DBMS/User Message: ' . $db->getUserInfo() . "\n";
echo 'DBMS/Debug Message: ' . $db->getDebugInfo() . "\n";
die($db->getMessage());
}
子索引文件:
<?php
include "../config.php";
$titleText = "The Store";
$titleImage = "Store.T.gif";
include "../includes/header.php";
include "getcats.php";
$bannerImage = "Ban_Store.jpg";
include "../includes/top.php";
?>
我的文件结构是默认的 GoDaddy cPanel 结构。配置文件在 public_html 中,索引文件在子目录中。你能提供的任何帮助都会很棒。提前致谢!
最佳答案
脚本不是从子页面的文件夹执行的,而是(可能)从根文件夹(document-root,即 public_html)执行的。为避免这样的“错误”,请使用绝对路径加载:
require __DIR__ . '/../config.php';
或者,查看 PHP 类自动加载。
关于php - 首页显示,但子页面显示require_once错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32513279/
给定默认路由,以下任一 URL 将导航到 Home Controller 的 Index 方法: 1. http://localhost 2. http://localhost/Home/Inde
可以在“设置”>“阅读”下找到 WordPress 阅读设置。 我将 WordPress 的“首页显示”选项设置为“静态首页”。 我的“首页”设置为“关于”。 我正在尝试为注销和登录用户设置不同的首页
我正在尝试禁用 Wordpress 首页上的插件,以使其更轻一些。我只想在显示首页时禁用它。 我在 wp-content/mu-plugins/中放置了这个工作代码它会禁用除指定/子页面/之外的所有页
有没有一种方法可以使首页包含 2 个 View ,而不使用 Drupal 6.x 中的面板模块? 谢谢 最佳答案 如果您不想使用面板,您可以将 2 个 View 创建为 block (就像侧边栏等一样
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我尝试管理基于 Plone 的网站 www.capital-tennis.org 上的内容。我对 Plone 本身几乎一无所知。 我想向网站的首页(主页面)添加 2 个 portlet,一个在左侧(在
如图所示,底部有 3 个 Controller ,分别是(HomeTableViewController、NavigationViewController 和 NewsViewController)
我开始在Windows上使用pentaho BI Server 5.2,并尝试通过本教程使用mysql配置进行安装: https://anonymousbi.wordpress.com/2013/12
我的首页(也就是发布帖子的页面)上的链接是红色的,悬停时它们会变成白色。但是在我的 STATIC 页面上,我希望链接在悬停时为白色和红色,我该怎么做? Tumblr 允许将 html 添加到您的静态页
我想创建一个网站 ala failblog.org,用户可以在其中提交内容并对内容进行投票 我想做的是 一种。向节点/文章添加一个字段,称为“front_page_at (date_time)” 湾。
注意:不能使用 Javascript 或 iframe。事实上,我不能相信客户端浏览器可以做任何事情,除了最基本的事情。 我正在将遗留的 PHP4 应用程序重建为 MVC 应用程序,目前我的大部分研究
我在这里不知所措。我觉得我已经尝试了所有的方法,并使用了其他帖子/教程中解释的确切方法。我知道您需要使用光标并设置第一个和最后一个可见文档,以便在向前移动的情况下从最后一个文档开始,在向后移动的情况下
我是一名优秀的程序员,十分优秀!