How to make a proxy stream through socks5 for PHP?
<p>I have this code:</p>

<pre class="lang-php prettyprint-override"><code>$opt = array(
    'socks5' =&gt; array( 
        'proxy' =&gt; 'tcp://proxyIP:port', 
        'request_fulluri' =&gt; true,
    )
);

$stream = stream_context_create($opt);

if ($s = file_get_contents("http://yandex.ru/internet",FILE_USE_INCLUDE_PATH,$stream))
echo $s;
</code></pre>

<p>It doesn't work I guess, because getting site shows my IP instead of proxy IP.</p>

<p>If I put <code>'http'</code> instead of <code>'socks5'</code> it works and shows me the proxy IP.</p>

<p>In my proxy server for 'http' I have port = <code>4000</code>, for 'socks5' port = <code>5000</code>.</p>

<p>But I really need to connect through SOCKS5. How can I do this?</p>