// Setup proxy settings in PHP from code:
$auth = base64_encode('username:password');
$opts = array(
'http' => array (
'method'=>'GET',
'proxy'=>'147.67.117.13:8012',
'request_fulluri' => true,
'header'=> array("Proxy-Authorization: Basic $auth", "Authorization: Basic $auth")
),
'https' => array (
'method'=>'GET',
'proxy'=>'147.67.117.13:8012',
'request_fulluri' => true,
'header'=> array("Proxy-Authorization: Basic $auth", "Authorization: Basic $auth")
)
);
$context = stream_context_create($opts);
$result = file_get_contents($url, null, $context);
// See file installer.php for installing composer
First of all, download composer
$curl -sS https://getcomposer.org/installer > installer.php
and run
$php installer.php
// setup proxy from the environment settings (~/.bashrc)
# proxy settings
export http_proxy=http://username:password@147.67.117.13:8012
export https_proxy=https://username:password@147.67.117.13:8012
export ftp_proxy=ftp://username:password@147.67.117.13:8012
export HTTP_PROXY=http://username:password@147.67.117.13:8012
export HTTPS_PROXY=https://username:password@147.67.117.13:8012
export FTP_PROXY=ftp://username:password@147.67.117.13:8012
export HTTP_PROXY_REQUEST_FULLURI=false
export HTTPS_PROXY_REQUEST_FULLURI=false