can php require any php file in my pc?
I set the apache www root folder to be d:\phpnow\htdocs, I thought that php can only require php files under this folder before ,such as require(‘laji/hello/a.php’);
today I found it php can load any php file in my PC ,only need the full path.
how to prevent ? it should not safe for web server.
Any file that the user whom the PHP program runs as has permission to access. (That is to say, filesystem permissions).
Limit the permissions on the file system or chroot the server so it runs in a sandboxed environment. (I’ve no idea if chrooting is possible on Windows)
It is perfectly safe unless either: