kenw232 0 Posted January 13, 2013 Share Posted January 13, 2013 I have a script that simply does this: <? $sCMD = `/bin/cat /tmp/test.txt`; echo $sCMD; ?> This works. But my open_dirbase does not include /bin or /tmp. Does anyone know why executing a program using backticks like this bypasses open_basedir? This should not work correct? I'm running PHP 5.3.16 on linux kernel 2.4. Link to post Share on other sites
Christian F. 232 Posted January 13, 2013 Share Posted January 13, 2013 I'd use built in PHP functionality, namely file_get_contents (). No need to invoke a shell command for something like this. Link to post Share on other sites
kicken 570 Posted January 13, 2013 Share Posted January 13, 2013 open_basedir is a PHP setting, and as such only has an effect on PHP's functions. When you run an external program that program is not subject to the same limitations as PHP is. Link to post Share on other sites
kenw232 0 Posted January 14, 2013 Author Share Posted January 14, 2013 open_basedir is a PHP setting, and as such only has an effect on PHP's functions. When you run an external program that program is not subject to the same limitations as PHP is. Thanks. That clears it up. Link to post Share on other sites
Recommended Posts
Archived
This topic is now archived and is closed to further replies.