我在HTML中編寫了一個網站,但我想在一個文件中的標題和導航欄部分,所以我只需要更改一次。我將所有頁面改爲.php並添加了php包含。但是,現在我在我放入文件夾的頁面上出現錯誤,因此我可以創建無格式鏈接。PHP包括 - 未能打開流:沒有這樣的文件
頭文件:/test/assets/header.php
作品:/test/index.php
包含<?php include 'assets/header.php'; ?>
拋出錯誤:/test/company/index.php
包含<?php include '/test/assets/header.php'; ?>
錯誤:
Warning: include(/test/assets/header.php) [function.include]: failed to open stream: No such file or directory
Warning: include() [function.include]: Failed opening '/test/assets/header.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear')
我有鏈接到頭文件中的問題即位於根文件夾中的文件夾中。我相信這是一個簡單的問題,只是不知道如何輸入URL。如果我嘗試包括完整路徑header.php中我得到了URL file-access is disabled
錯誤
經常遇到此錯誤,並快速排除故障,請按照下列步驟操作:https://stackoverflow.com/a/36577021/2873507 – 2016-04-12 15:37:03
可能重複的[無法打開流:沒有這樣的文件或目錄]( http://stackoverflow.com/questions/36577020/failed-to-open-stream-no-such-file-or-directory) – 2016-09-10 09:20:48