Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-25-2006, 08:05 PM   #1
LQ Newbie
Registered: Mar 2006
Posts: 4

Rep: Reputation: 0
Can I just copy an executable libray to Linux and expect it to work?


I am using a web hosting company that does not allow me to compile anything and I would like to use the mcrypt library in my PHP scripts.

I have installed a Centos Linux distro locally and have worked out that I can use the library without re-compiling PHP by just calling mcrypt from inside my scripts. This works fine locally.

However I just discovered I dont have access to the /usr/lib tree or anything else I had taken for granted and only have a cgi-bin directory to run binaries from

The Question

So my question is - would it be possible for me to copy compiled libraries (libmcrypt, mhash and the mcrypt code) to the cgi-bin tree and have a way to make them work bearing in mind I can not:

1. modify
2. run ldconfig

Obiously on a Widoze machine I'd just copy the executable somewhere in the existing search path & run it but I dont know if this is possible under linux (theres big gaps in my knowledge at the moment)

Any info about using these libraries without having (What I assumed were) basic system access would be welcome.

I do have a fallback solution but it would be really painful to implement.

I'm happy to script/program solutions for this in any language.

If this simply can't be done I'd appreciate someone just telling me.


Old 03-25-2006, 08:34 PM   #2
Registered: May 2004
Posts: 552

Rep: Reputation: 31
Before doing that check with your service provider, if they don't allow these programs (which is what it sounds like), you can expect to get a very nasty email from them in the near future. Most of the providers I've been with allow compiled CGI programs only if the source is also somewhere they can view. Policies vary however.
To answer your question there is no way to tell if it will work unless you try it.
Build a test compiled program that just outputs a hello world page when run.
It sounds like they are running the web server in a chrooted environment and have only copied certain libraries over.
Old 03-25-2006, 10:25 PM   #3
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
you will most likely in the job controll setup somehow set the shell variable
LD_LIBRARY_PATH to include the libs
Old 03-26-2006, 10:41 AM   #4
LQ Newbie
Registered: Mar 2006
Posts: 4

Original Poster
Rep: Reputation: 0

Thanks for the replies - I was half afraid everyone would just laugh
and go away tutting ;-)

I didnt want to just try this locally as I couldnt be sure I'd removed
what I'd already installed totally. I guess I could just format and re-install the OS
from scratch ... hmm ...maybe I'll do that. I dont want to try it on the host untill I've
proved it locally.

Just knowing it might be possible makes it worth investing the time - I did see
the LD_LIBRARY_PATH information in the docs but as I mentioned my Linux skills are very sparse at the moment and I wasn't sure about exactly what it would allow me to do. I'll try that too.

I'm not worried about angry emails - I suspect I will need to find another host anyway if I can't get easier use of what seem to be standard packages. I dont need root access but something a little better than the terse (to say the least) respnses I get to my requests for help on what I can and can't do are going to be essential.

again thanks for the pointers.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
executable doesn't work on 2.5" USB2.0 HD cyu021 Linux - Hardware 2 10-16-2005 07:53 AM
Copy of Suse Linux 9.2 DVD don't work pointer SUSE / openSUSE 4 12-10-2004 10:41 AM
Copy of Suse Linux 9.2 DVD don't work pointer SUSE / openSUSE 3 12-08-2004 08:13 PM
C++ runtime libray Penguin Dropout Programming 3 06-02-2003 02:01 PM
untared executable files don't work jlb Linux - Newbie 2 06-11-2002 06:44 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration