[英]How to compile a linux app to run on a shared web server
I am trying to get a small C application to run on my web server. 我正在尝试使一个小型C应用程序在我的Web服务器上运行。 The web hosting company is HostGator and we have their least-expensive plan 'Hatchling'
网络托管公司是HostGator,我们有他们最便宜的计划'Hatchling'
Unfortunately this particular plan does not provide access to a compiler, which means I'll need to build it on a similar machine to that server and transfer the executable there. 不幸的是,这个特定的计划不提供对编译器的访问,这意味着我需要在与该服务器类似的机器上构建它,并在其中传输可执行文件。
My question is how 'close' do I have to get to the Linux distribution on that web server for this to work? 我的问题是,我必须多“接近”才能到达该Web服务器上的Linux发行版,才能正常工作? I currently have a recent Ubuntu in a VM and would like to use it for this process but maybe some complex differences in how Ubuntu compiler chain is built versus what can work on the web server are too great?
我目前在VM中拥有一个最新的Ubuntu,并且想在此过程中使用它,但是也许在构建Ubuntu编译器链与在Web服务器上可以运行什么方面有一些复杂的差异?
Would I need to install the CentOS release 6.5 they use and compile on that? 我需要安装他们使用的CentOS版本6.5并在该版本上编译吗?
What do you recommend I do to attack this problem? 您如何建议我解决这个问题?
John, 约翰,
PS Hostgator runs 'CentOS release 6.5 (Final)' and /proc/version returns "Linux version 3.2.52 (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) )" PS Hostgator运行“ CentOS 6.5版(最终版)”,/ proc / version返回“ Linux版本3.2.52(gcc版本4.4.7 20120313(Red Hat 4.4.7-3)(GCC))”
It is worth checking that the architecture is the same eg Intel - 32bit or 64bit. 值得检查架构是否相同,例如Intel-32bit或64bit。 In theory 32bit will work on a 64bit architecture as long as supporting libraries have been installed.
从理论上讲,只要安装了支持库,32位就可以在64位体系结构上工作。
Dependancies are the other challenge you will have. 依赖关系是您将面临的另一个挑战。
Versions of GCC and Kernel versions do not matter too much. GCC版本和内核版本无关紧要。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.