打开'页面失败/'包含(include_path ='。; C:\ Program Files(x86)\ DevDesktop \ common \ pear')index.php在第18行

时间:2016-10-28 14:06:12

标签: php .htaccess warnings pear permission-denied

当我使用.htaccess文件制作项目时,出现错误。

  1. 第一个错误是
  2.   

    include(D:\ learnphp \ drupal-7.43 \ site \ pages):无法打开流:   第18行的D:\ learnphp \ site \ index.php中的权限被拒绝

    1. 第二个是
    2.   

      include():未能打开'页面/'包括在内   (include_path ='。; C:\ Program Files(x86)\ DevDesktop \ common \ pear')in   第18行的D:\ learnphp \ drupal-7.43 \ site \ index.php

      这是我的index.php

      <?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文件

      RewriteEngine on
      RewriteCond %[REQUEST_FILENAME] !-f
      RewriteCond %[REQUEST_FILENAME] !-d
      RewriteRule ^(.*)$ index.php?path=$1 [L,QSA]
      

1 个答案:

答案 0 :(得分:0)

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

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

通常情况下,目录具有0755权限和php文件0644就足够了。