代理卷曲不工作通过Exec,但在命令行
问题描述:
所以我想使用从我的代理列表文本文件中的随机代理卷曲。代理卷曲不工作通过Exec,但在命令行
这里就是我把从这样你就可以得到一些方面的文件:http://orcahub.com/proxy-list/
这只是与代理列表的txt文件。
反正我有一个脚本,其格式与随机代理
当我刚呼应格式,然后复制并粘贴输出到命令行它完美的作品,但是当我执行我得到一个奇怪的错误卷曲请求。
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 16: syntax error: unexpected end of file
这里是我当前的代码
$f_contents = file("cleanedxml4.txt");
$line = $f_contents[array_rand($f_contents)];
$data = $line;
$pieces = explode(" ", $data);
$woah = $pieces[0];
$loah = $pieces[1];
$f_contents = file("proxies_265.txt");
$line = $f_contents[array_rand($f_contents)];
$data = $line;
$format = 'curl '.$loah.' -d \'<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>pingback.ping</methodName>
<params>
<param>
<value>
<string>'.$url.'</string>
</value>
</param>
<param>
<value>
<string>'.$woah.'</string>
</value>
</param>
</params>
</methodCall>\'';
$data = preg_replace("/\r|\n/", "", $data);
$format = $format . " --proxy " . $data . " -m 5";
$format = 'bash -c "exec nohup setsid ' . $format . ' > /dev/null 2>&1 &"';
exec($format);
//echo $format . "\n\n";
答
嗯,什么是xml'ing你的代码这么多的好主意?这里是为我工作我校服务器(无curlopt支持):
exec('curl -s --connect-timeout '.$this->_connect_timeout.' -x '.$ip.':'.$port.' '.$this->_target_url.' > '.$hide.' 2>&1');
可以看出,我输出保存到服务器上的一个隐藏文件,这适合我的需求刮板(my question here)。希望这会有所帮助,稍后会有所帮助。