可以这样做吗?我已经看过命令行指令,但似乎passwd是一个交互式命令,我们无法通过PHP响应。 感谢
答案 0 :(得分:0)
最简单的解决方案是使用popen
和chpasswd
。
$handle = popen('/usr/sbin/chpasswd', 'w');
fputs($handle, "user:password");
fclose($handle);
答案 1 :(得分:0)
或尝试使用CURL模拟人类。 登录+创建帐户。一个表单http://curl.haxx.se/mail/curlphp-2004-04/0013.html
的简单示例