简体   繁体   中英

Can't include files with PHP

I've a WEMP server with PHP 5.3.28 installed on a Windows Server 2003.
Everything works, except for require , I've in my script.

This is the relevant code:

<?
require('info.php');
echo 'root directory require<br>';
require('subpath/info.php');
echo 'sub directory require<br>';

The problem is that the require of the info.php located in the root directory works, but the one in the sub-directory doesn't.

The script breaks on the first require() which contains a sub-directory without throw errors.

I've checked that PHP have permissions to read the sub-directory trying with file_exists() and file_get_contents() and everything works flawlessly.

No errors are reported in the Nginx log or PHP log.
How can I fix this problem?

NB: The same script on my WEMP server installed on my workstation with Windows 7 works.

尝试

require 'subpath'.DIRECTORY_SEPERATOR.'info.php';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM