Search code examples
phpgitgithubproxybitbucket

502 proxy error while pulling the code from git repo


I am writing a php script where it clones first and then pulls from a bitbucket git repo.

It works well on my local machine, but on dev server there is proxy configured, so whenever i tried to run the script on server it gives "502 proxy error"

when i directly try to clone from command line on dev server it works. some google links suggested to configure global proxy like

git config --global http.proxy proxyserver:port

I tried this as well, but not working through script.

Please help.


Solution

  • I ended up using following command before pulling repo in script.

    git --config http.proxy=http://proxy_host:proxy_port