Moderators: Synology Inc, Honorary Moderator







adamszki wrote:According to my php.ini in /usr/syno/etc the safe mode is off but whatever php script tries to use the shell_exec() command gets a result saying that shell_exec() is not available in safe mode. Does somebody have an idea where the error might be?
Thanx.
Warning: shell_exec() [function.shell-exec]: Cannot execute using backquotes in Safe Mode in /volume1/web/util/test.php on line 2<?php
print `ls -la /volume1/web`;
?>
Regarding the PHP-functionality, I cannot use the group of shell functions in PHP (popen, shell_exec. and others). I know they are potentially risky, but it makes impossible to use certain applications. How can I reactive or reenable these functions? I have telnet/root access to the DS106, but I couldn't find any settings in php.ini or elsewhere, reagrding this issue.
About the "PHP" issue, please edit /usr/syno/etc/php.ini and set the safe_mode_exec_dir to other dir.
For example, if you want to exec command in /bin, just set it to /bin.
However, we do not take any response in such operation and the warranty will be invalid.


lookatbowen wrote:Here is the "how to enable SSH/Telnet" on your diskstation.
http://oinkzwurgl.org/dl.php?file=syno-telnet-r3.zip

Does it work in latest firmware version 428?

glem01 wrote:Hi,
this seems to be an important and undocumented issue, that is not usual in standard php. I asked Synology about this same point a few months ago:Regarding the PHP-functionality, I cannot use the group of shell functions in PHP (popen, shell_exec. and others). I know they are potentially risky, but it makes impossible to use certain applications. How can I reactive or reenable these functions? I have telnet/root access to the DS106, but I couldn't find any settings in php.ini or elsewhere, reagrding this issue.
And they answered me:About the "PHP" issue, please edit /usr/syno/etc/php.ini and set the safe_mode_exec_dir to other dir.
For example, if you want to exec command in /bin, just set it to /bin.
However, we do not take any response in such operation and the warranty will be invalid.
I did so, and it works fine since then. I just put only the reall yneeded executables into the specified directory as defined by the variable safe_mode_exec_dir in php.ini.
Hope this helps you too.
Manuel

Users browsing this forum: No registered users and 1 guest