PHP is hosted locally by connecting to external resources through a proxy server

I am trying to create a local facebook program, but I am on a university network, and therefore all outgoing connections from my computer must go through our proxy server. The main problem I am facing is that I cannot find documentation on configuring apache to use a proxy server, and not for ACT as a proxy server.

If you think about it, maybe when I make a β€œcURL” or fopen request, this apache does not perform data extraction, and the PHP drivers do it instead. Older versions allowed you to configure the global proxy server in the PHP.ini file, but not in PHP 5.

I need to use the code to actually physically set the default values, and cannot find any configuration files where I can set them forever. For example, this sets up threads, so the fopen function can function:

    $r_default_context = stream_context_get_default
    (
    array
        (
        'http' => array
            ( // All HTTP requests are passed through the local NTLM proxy server on port 8080.
            'proxy' => 'tcp://proxy.munged.edu:8080',
            'request_fulluri' => True,
            ),
        )
    );

but this will not install everything that is required to use cURL, I have to do this:

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_PROXY, "http://proxy.munged.edu:8080");
    curl_setopt($ch, CURLOPT_PROXYPORT, 8080);

Is there anyone who knows how to install anything that requires outgoing connections, use this proxy server, since I will not code it for this computer (because my plan was to work on my code locally, and then download it to some webspace when this was done: the change / upload / refresh loop takes more time than just this change / update loop)

edit:

, "proxyconfig.php", () . , , facebook.php API, .

+3
1

, , iframe ( FBML , Facebook ).

, , BaseFacebook LocalBaseFacebook CURL_OPTS

public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 10,
    CURLOPT_USERAGENT      => 'facebook-php-3.0',
    CURLOPT_PROXY          => 'http://proxy.munged.edu:8080',
    CURLOPT_PROXYPORT      => 8080
);

, Facebook / ( $_GET, ​​? is_local = 1) URL.

+1

All Articles