【发布时间】:2012-02-01 21:38:27
【问题描述】:
我的 PHP 类中有以下命令:
@exec('nslookup -type=' . $type . ' ' . escapeshellcmd($host), $output);
由于安全限制,它不能在我的服务器上运行(exec 和 escapeshellcmd 在 php.ini 中被禁用)。有没有不依赖exec的替代方案?
【问题讨论】:
-
旁注:对于单个参数,您应该使用
escapeshellarg而不是escapeshellcmd。