我是php的新手,但在其他语言中做了很多开发。我继承了另一个开发人员创建的系统。代码应显示使用CSS格式化的标准化表单。它应该在右侧显示一个导航菜单,其中包含一个动态变化的文本标题,然后显示一个页面,然后显示一些内容。它在Mac上本地运行良好。我已将项目迁移到PC。当我尝试运行它的index.php页面时,我收到以下错误:
(!)警告:未知:未能打开流:第0行的未知权限被拒绝
(!)致命错误:未知:未能打开所需的'C:/wamp/www/styleguide/index.php'(include_path ='。; C:\ wamp \ bin \ php \ php5.5.12 \ pear')在第0行的未知中
在论坛中查看类似错误后,我检查了文件权限,所有文件都给了我完全访问权限,不是只读的。我测试了Pear,看起来效果很好。 Phpinfo显示我有正确的include_path。我编写的其他PHP代码在PC上运行良好,可以执行require_once。错误日志显示相同的消息,因此我无法确定哪些文件导致问题。
我在Windows 7 64位计算机上运行带有Apache v2.4.9的Wampserver 2.5和带有PEAR发行版1.9.5的php v5.5.12。任何建议将不胜感激。
以下是Index.php的内容
<?require_once('includes/header.html');
head("Style Guide | Welcome!");
?>
<body id="welcome">
<div class="scroller"></div>
<div class="midcontent">
<?php include("includes/welcome-msthd.html"); ?>
<?php include("includes/welcome-content.html"); ?>
</div>
<div class="holderbox">
<?php include("includes/navs.html"); ?>
</div>
</body>
<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
</html>
以下是includes / header.html
的内容<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<link rel="shortcut icon" href="http://www.allmysons.com/images/amsfav.ico" type="image/x-icon" />
<link href="css/css3.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Waiting+for+the+Sunrise' rel='stylesheet' type='text/css'>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<META NAME="GOOGLEBOT" CONTENT="NOARCHIVE">
<!--Bookmark Code -->
<script type="text/javascript">
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
<!--Remember to add new IDs for new pages below! -->
<style type="text/css">
#welcome li#welcomelink a,
#generalrulesoverview li#generalrulesoverviewlink a,
#employeeuniform li#employeeuniformlink a,
#generalrulessocialmedia li#generalrulessocialmedialink a,
#logodownloads li#logodownloadslink a,
#logodosanddonts li#logodosanddontslink a,
#logocolors li#logocolorslink a,
#logousageandfonts li#logousageandfontslink a,
#emailtemplate li#emailtemplatelink a,
#emailsignatures li#emailsignatureslink a,
#businesscardoverview li#businesscardoverviewlink a,
#orderabusinesscard li#orderabusinesscardlink a,
#brochureordoorhangeroverview li#brochureordoorhangeroverviewlink a,
#thankyoucards li#thankyoucardslink a,
#orderabrochureordoorhanger li#orderabrochureordoorhangerlink a,
#billboards li#billboardslink a,
#changeofaddressform li#changeofaddressformlink a,
#tshirts2 li#tshirtslink a,
#managershirts li#managershirtslink a,
#otherapparel li#otherapparellink a,
#orderapparel li#orderapparellink a,
#taglines li#taglineslink a,
#truckart li#truckartlink a,
#content-submission li#content-submission-link a,
#orderestimatorfolder li#orderestimatorfolderlink a
{ color: #fff; }
a:link {color: #ccc; text-decoration: none;}
a:visited {text-decoration: none;color: #ccc;}
a:hover {text-decoration: none;color: #fff;}
a:active {text-decoration: none;color: #ccc;}
</style>
<!--Code below dynamically inserts page title (from page) -->
<?php
function head($title){
if(!$title){
$title="Default page title";
}
?>
<title><?php print $title; ?></title>
</head>
<?php } ?>
以下是includes / welcome-msthd.html
的内容!--Masthead -->
<div class="versiondate">Version 2.0 | 4-20-12</div>
<div class="header">My Company Name</div>
<div class="header2">Company Style Guide and Resources</div>
<div class="header3">Welcome!</div>
<!--Masthead -->
<div class="versiondate">Version 2.0 | <?php include("includes/updated.html"); ?></div>
<div class="header">All My Sons Moving & Storage</div>
<div class="header2">Company Style Guide and Resources</div>
<div class="header3">Order Estimator Folders</div>
以下是includes / welcome-content.html
的内容<!--Content -->
<div class="content">
<strong>Some content welcoming the user </strong><br /><br />This is some welcome text <a style="color:#3a7124; text-decoration:underline;" href="mailto:myemail@mycompany.com?subject=Style Guide Help Request">contact us</a> for help.
<div>
<?php include("includes/footer.html"); ?>
</div>
</div>
<!--Content -->