Dail
Dail

Reputation: 21

Can I use open_basedir or is it deprecated?

Excuse me in advance for the strange question :-)

I'm using the last stable php version, and I want to "jail" php scripts. (I tried to chroot, but it is boring.

I would like to use open_basedir directive on php.ini, but I don't know with it's deprecated or not. I searched on Google and 99% times the page redirect to http://php.net/manual/en/features.safe-mode.php (DEPRECATED).

So my question is, Can I use this directive or not? is it sure?

Thank you really much

Upvotes: 0

Views: 1406

Answers (3)

dev-null-dweller
dev-null-dweller

Reputation: 29462

http://php.net/manual/en/ini.core.php#ini.open-basedir

There is nothing about this directive being deprecated. But restricting directory access with this does not prevent other people to see someone else code (ex using shell_exec and cat). So I would suggest to disable all functions that allows external program execution or use patch for php to allow only trusted executables from specified directory http://www.kyberdigi.cz/projects/execdir/english.html

On a side note, jail chroot is not boring, it's exciting considering how much work it requires to get all running ;)

Upvotes: 0

Timofey Stolbov
Timofey Stolbov

Reputation: 4621

From http://www.php.net/manual/en/ini.core.php#ini.open-basedir, so this feature doesn't rely on safe_mode.

This directive is NOT affected by whether Safe Mode is turned On or Off.

Upvotes: 3

symcbean
symcbean

Reputation: 48357

PHP Safe Mode is deprecated. open_basedir is NOT deprecated. There is a lot of overlap between what these constructs address.

Upvotes: 3

Related Questions