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'; ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向