首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在第18行打开'pages/‘以便包含(include_path=.;C:\Program(X86)\DevDesktop\公用\pear’) index.php失败

问在第18行打开'pages/‘以便包含(include_path=.;C:\Program(X86)\DevDesktop\公用\pear’) index.php失败
EN

Stack Overflow用户
提问于 2016-10-28 14:06:12
回答 1查看 287关注 0票数 1

当我用.htaccess文件制作这个项目时,我得到了一个错误。

  1. 第一个错误是

包括(D:\learnphp\Drupal-7.43\site\pages):打开流失败:在第18行的D:\learnphp\site\index.php中拒绝权限

  1. 第二个是

包含():打开包含的'pages/‘失败(include_path=.;C:\Program(X86)\DevDesktop\path\pear’)在D:\learnphp\drupal-7.43\site\index.php第18行中

这是我的index.php

代码语言:javascript
复制
<?php

// Moved functions to their own file so we can use them in page files.
include('includes/functions.php');

// If this is index.php, we won't get a path, so we need to set it.
$path = isset($_GET['path']) ? $_GET['path'] : 'home.php';


// Render featured products.
$featured_product_output = render_product(get_setting('featured_product_ids'));

// Get some variable to use in the templates.
$company_name = get_setting('company_name');
$year = date('Y');

// Include the file that matches the path name.
include('pages/' . $path);

include('includes/page-template.php');

这是.htaccess文件

代码语言:javascript
复制
RewriteEngine on
RewriteCond %[REQUEST_FILENAME] !-f
RewriteCond %[REQUEST_FILENAME] !-d
RewriteRule ^(.*)$ index.php?path=$1 [L,QSA]
EN

回答 1

Stack Overflow用户

发布于 2016-10-28 14:26:19

检查目录D:\learnphp\drupal-7.43\site\pages的权限/所有权。

它导入了用户php (执行php脚本的用户)可以访问要包含的文件。

通常,目录拥有0755权限和php文件0644就足够了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40306859

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档