Information About Installing Symphony in a Proxy Environment

Asked 1 years ago, Updated 1 years ago, 92 views

If you try to download the Symphony Installer in a proxy environment, a communication error occurs and you cannot download it.
I set the environment variable because I thought php didn't know to use the proxy because I can download symfony.phar when I access it with a browser, but it didn't work.
Could you tell me how to make php recognize the proxy?

Environment
Windows 7 SP1 x86 php Ver 5.6.21
set HTTP_PROXY=http://proxyserver:ports/
set HTTP_PROXY_REQUEST_FULLURI=1

Executing Commands
php-r "file_put_contents('symfony', file_get_contents('http://symfony.com/installer');"

Error Messages
Warning: file_get_contents(...):failed to open stream:
Connected caller did not respond correctly after a certain amount of time, so connection is possible
US>Failed, or an established connection fails because the connected host did not respond
Yes.
in Command line code on line 1

Thank you for your cooperation.

php symfony2

2022-09-30 20:10

1 Answers

If you create a ↓context and specify it as an argument, it seems that you can go through the proxy.
It might be difficult to use one liner.
http://php.net/manual/ja/function.stream-context-create.php#111032

Is it not possible to use cURL?
curl-L"http://symfony.com/installer ">symfony.phar


2022-09-30 20:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.