How to configure PHP to not allow symbolic links?

My file system is designed to host all projects as follows:

/[path to server]/[client name]/[project name] 

Each /[client name]/[project name] has a symbolic link that is built using UUIDs (36 characters long). Therefore, requests /[uuid] allow the corresponding /[client name]/[project name] .

I ran into a problem at the PHP level. PHP automatically resolves any symbolic links to realpath. Instead, I want PHP to use a symbolic path.

The main problem I encountered is the protection of client identifiers. Therefore, whether a PHP exception is thrown, any error or __FILE__ or __DIR__ unloaded, it should contain a symbolic link, not a real trajectory.

Is it customizable?

+4
source share
1 answer

Is it customizable?

No. You need to fix the PHP source and recompile.

There may be some chance (but I don't know how far this is) by replacing the default wrapper file:// . But probably not for the main script.

+1
source

Source: https://habr.com/ru/post/1438515/


All Articles