dongmiao260399 2015-05-15 16:51
浏览 7
已采纳

php上一个目录 - 无法上班

I am trying to include a .php file, but to do so I need to go up two directories, however I cannot seem to make it work. Here is my code:

<?php include '../asset/scripts/php/portfoliohome.php'; ?>

Here is what the file structure looks like:

C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\website\pages\index.php

I am wanting to go from index.php up to website, and then I can include the .php from /asset/scripts/php/portfoliohome.php.

portfoliohome.php location:

C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\website\asset\scripts\php\portfoliohome.php

This is the error I receive:

Warning: include(.../asset/scripts/php/portfoliohome.php): failed to open stream: No such file or directory in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\website\pages\index.php on line 1

  • 写回答

1条回答 默认 最新

  • douluolan9101 2015-05-15 16:55
    关注

    To go up 2 directories use ../ twice

    <?php include '../../asset/scripts/php/portfoliohome.php'; ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?