1. include files on cgi-bin

In orden to run cgi-bin programs on a web server, I have copied /std folder inside /public_html/cgi-bin

Any suggestion for better practices?

Marco Achury

new topic     » topic index » view message » categorize

2. Re: include files on cgi-bin

achury said...

In orden to run cgi-bin programs on a web server, I have copied /std folder inside /public_html/cgi-bin

Any suggestion for better practices?

I going to assume you're running Apache web server on a Debian-based Linux distribution. Here is what I typically do.

Step 1: Download Euphoria 4.1 64-bit from GitHub.

$ wget -q https://github.com/OpenEuphoria/euphoria/releases/download/4.1.0/euphoria-4.1.0-Linux-x64-57179171dbed.tar.gz 

Step 2: Extract only the bin and include directories to /usr/local/euphoria-4.1.0-Linux-x64.

$ sudo tar -C /usr/local -xzf euphoria-4.1.0-Linux-x64-57179171dbed.tar.gz euphoria-4.1.0-Linux-x64/{bin,include} 

Step 3: Symlink the executables from bin directory into /usr/local/bin (which should be in the environment PATH).

$ cd /usr/local/bin 
$ sudo find /usr/local/euphoria-4.1.0-Linux-x64/bin -type f -executable -exec ln -s {} \; 

The trick here is that the eu.cfg in that package points to the directory where we put the files, including the -i option which indicates where to look for include files.

$ cat /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.cfg 
[all] 
-d E64 
-eudir /usr/local/euphoria-4.1.0-Linux-x64 
-i /usr/local/euphoria-4.1.0-Linux-x64/include 
[translate] 
-arch ix86_64 
-gcc 
-con 
-com /usr/local/euphoria-4.1.0-Linux-x64 
-lib-pic /usr/local/euphoria-4.1.0-Linux-x64/bin/euso.a 
-lib /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a 
[bind] 
-eub /usr/local/euphoria-4.1.0-Linux-x64/bin/eub 

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: include files on cgi-bin

Thank you Greg for the excellent installation advice.

Broadening the topic slightly: can you give correspondingly good advice on the location of 'so' files for best Euphorian access. (I ask because I have two machines with near identical setups, where open_dll can "find" all my 'so's in one case whereas in the other case it can only find some - not none, though!)

new topic     » goto parent     » topic index » view message » categorize

4. Re: include files on cgi-bin

dr_can said...

Thank you Greg for the excellent installation advice.

Broadening the topic slightly: can you give correspondingly good advice on the location of 'so' files for best Euphorian access. (I ask because I have two machines with near identical setups, where open_dll can "find" all my 'so's in one case whereas in the other case it can only find some - not none, though!)

Anything you're installing by hand should go into /usr/local/lib, which should be in the default search path for shared libraries on common distros like Debian, Ubuntu, Fedora, etc.

Euphoria relies on dlopen() so reading that man page helps understand how it's searching and why the loading can fail.

Unfortunately the man page outright states, "if dlopen() fails for any reason, it returns NULL." So working out "cannot find" versus "cannot load" can be tricky.

If you've got your libraries in /usr/local/lib, if they still aren't loading, run them through ldd and look for instances of not found. These are dependencies you need to resolve.

If you're missing any dependencies, you'll get output similar to this:

$ ldd /usr/local/lib/libname.so | grep 'not found' 
  libsomething.so => not found 

If you're on Debian/Ubuntu/etc. and are unsure which package is required to install the missing library, you can try searching with apt-file.

$ sudo apt install apt-file 
$ sudo apt-file update 
$ apt-file find libsomething.so 

-Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: include files on cgi-bin

Greg

Thank you for this. I read the dlopen manual page and managed to solve the problem. For the record I think my issue was one of dependencies within 'so's, so that once the core library was recognised by dlopen then all the "children" were OK as the "parent" was then found.

The general information and approach is so useful that I think it should be stored somewhere for others to access. For my part I have copied it and stored it on my machine.

Many thanks

Charles

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu