基金会无法在 php 本地主机连接中工作
Foundation not working in php localhost connection
我可以连接到我的 php 文件并通过 mac 上的 apache 在我的 Web 浏览器中显示它,然后 http://localhost/~username/file.php 但是当我这样做时它无法识别任何语法zurb 基金会相关。该网页看起来与我在本地查看时完全不同 html,而不是通过此服务器连接。
我不确定这是否也相关,但我尝试过先在我的桌面上显示带有我的 foundation-5 文件夹的文件,然后在站点文件夹中,然后在带有 php foundation-5 文件夹中的文件。最后一个选项显示 403 禁止错误 "You don't have permission to access /~username/foundation-5/sample.php on this server. Server unable to read htaccess file, denying access to be safe"
下面是我的代码。
<?php
$link = mysql_connect('127.0.0.1', 'root', '$password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Database</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
</head>
<style>
body {
background-color: ;
}
</style>
<body>
<style>
h1 {
text-align: center;
}
h3 {
text-align: center;
}
h5 {
text-align: center;
}
</style>
<div class="row">
<div class="large-12 columns">
<h1>Welcome!</h1>
<hr/>
</div>
</div>
<div class="row">
<div class="large-3 medium-3 columns">
<div class="panel">
<h5>Jump To:</h5><br/>
<a href="#User" class="small radius button">User Queries</a>
<a href="http://foundation.zurb.com/docs/" class="small radius button">Link</a>
</div>
</div>
<div class="large-9 columns">
<div class="panel">
<a name="User"> <h3>User Queries</h3><br/></a>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 1</strong></a><br/>Query 1 Description</p>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 2</strong></a><br/>Query 2 Description</p>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 3</strong></a><br/>Query 3 Description</p>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 4</strong></a><br/>Query 4 Description</p>
</div>
</div>
</div>
<hr/>
</div>
</div>
</div>
<script src="foundation-5/js/vendor/jquery.js"></script>
<script src="foundation-5/js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
已解决。必须给我的 foundations-5 文件夹 755 权限——以防其他人遇到这个问题。
我可以连接到我的 php 文件并通过 mac 上的 apache 在我的 Web 浏览器中显示它,然后 http://localhost/~username/file.php 但是当我这样做时它无法识别任何语法zurb 基金会相关。该网页看起来与我在本地查看时完全不同 html,而不是通过此服务器连接。
我不确定这是否也相关,但我尝试过先在我的桌面上显示带有我的 foundation-5 文件夹的文件,然后在站点文件夹中,然后在带有 php foundation-5 文件夹中的文件。最后一个选项显示 403 禁止错误 "You don't have permission to access /~username/foundation-5/sample.php on this server. Server unable to read htaccess file, denying access to be safe"
下面是我的代码。
<?php
$link = mysql_connect('127.0.0.1', 'root', '$password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Database</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
</head>
<style>
body {
background-color: ;
}
</style>
<body>
<style>
h1 {
text-align: center;
}
h3 {
text-align: center;
}
h5 {
text-align: center;
}
</style>
<div class="row">
<div class="large-12 columns">
<h1>Welcome!</h1>
<hr/>
</div>
</div>
<div class="row">
<div class="large-3 medium-3 columns">
<div class="panel">
<h5>Jump To:</h5><br/>
<a href="#User" class="small radius button">User Queries</a>
<a href="http://foundation.zurb.com/docs/" class="small radius button">Link</a>
</div>
</div>
<div class="large-9 columns">
<div class="panel">
<a name="User"> <h3>User Queries</h3><br/></a>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 1</strong></a><br/>Query 1 Description</p>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 2</strong></a><br/>Query 2 Description</p>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 3</strong></a><br/>Query 3 Description</p>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="callout panel">
<p><a href="http://foundation.zurb.com/docs"><strong>Query 4</strong></a><br/>Query 4 Description</p>
</div>
</div>
</div>
<hr/>
</div>
</div>
</div>
<script src="foundation-5/js/vendor/jquery.js"></script>
<script src="foundation-5/js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
已解决。必须给我的 foundations-5 文件夹 755 权限——以防其他人遇到这个问题。