在共享主机上安装 GIT 时出现 zlib 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12900826/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
zlib error installing GIT on shared hosting
提问by dclawson
I am attempting to install git onto my UK2 shared hosting server, following this guide:
我正在尝试按照本指南将 git 安装到我的 UK2 共享托管服务器上:
http://www.randallkent.com/development/install-git-on-a-cpanel-shared-hosting-account
http://www.randallkent.com/development/install-git-on-a-cpanel-shared-hosting-account
I have got to the very last couple of steps 'make' & 'make install' when i receive the following error:
当我收到以下错误时,我已经完成了最后几个步骤“make”和“make install”:
config.status: executing config.mak.autogen commands
* new build flags
CC credential-store.o
In file included from credential-store.c:1:
cache.h:19:18: warning: zlib.h: No such file or directory
In file included from credential-store.c:1:
cache.h:21: error: expected specifier-qualifier-list before ‘z_stream'
make: *** [credential-store.o] Error 1
My hosting provider has enabled zlib compression for me but i am still unable to install git.
我的托管服务提供商为我启用了 zlib 压缩,但我仍然无法安装 git。
Is there something I am missing or is it not possible on my hosting server?
是否有我遗漏的东西或在我的托管服务器上不可能?
Thanks very much
非常感谢
回答by neotam
It seems to be you have to install zlib.
If you are using Centos, install zlib by using yum install zlib-devel
If you are using Debian, install zlib by using apt-get install zlib1g-dev
.
If you wanna get source grep it from http://www.zlib.net/and install it, if you do this sure you will have git in your system.
Note: If you install git from the aptitude package manager or from repositories it will automatically install the dependencies.
看来你必须安装zlib。如果您使用的是 Centos,请使用以下命令安装 zlibyum install zlib-devel
如果您使用的是 Debian,请使用apt-get install zlib1g-dev
. 如果你想从http://www.zlib.net/获取源码 grep 并安装它,如果你这样做,你肯定会在你的系统中安装 git。注意:如果您从 aptitude 包管理器或存储库安装 git,它将自动安装依赖项。
回答by arezae
You only need to use ./configure --with-zlib={your zlib path}
你只需要使用 ./configure --with-zlib={your zlib path}
It helped me to compile git with this option.
它帮助我用这个选项编译 git。
回答by Rees McIvor
I have had the same issue with a client who is hosted on their server. But thankfully cpanel comes with a version of GIT. Its at "/usr/local/cpanel/3rdparty/bin/git"
我在托管在其服务器上的客户端遇到了同样的问题。但幸运的是,cpanel 附带了一个 GIT 版本。它在“/usr/local/cpanel/3rdparty/bin/git”
You can see a fix here: http://www.codefuel.co.uk/cpanel-git-resolved/
你可以在这里看到一个修复:http: //www.codefuel.co.uk/cpanel-git-resolved/