2015-11-05 125 views
0

我可以连接到我的PHP文件,并通过apache在mac上显示它在我的网络浏览器,然后http://localhost/~username/file.php,但是当我这样做并不认可任何语法是与基金有关的。该网页看起来完全不同,如果我把它看作本地化的html,而不是通过这个服务器连接。基金会不工作在PHP本地主机连接

我不确定这是否也是相关的,但我试过用我的基金会-5文件夹显示文件,最初在我的桌面上,然后在网站文件夹,然后在php文件的网站文件夹在foundation-5文件夹内。最后一个选项显示403禁止错误“您无权访问此服务器上的/~username/foundation-5/sample.php服务器无法读取htaccess文件,拒绝访问是安全的”

下面是我的代码。

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

回答

0

解决。不得不给我的基金会 - 5文件夹755权限 - incase其他人有这个问题。