views:

285

answers:

5

I am installing imgseekweb according the instructions. I installed or had my hoster install imgSeekWeb.py, iswImage/images folder, iswImage/thumbnail folder, Python Imaging Library (PIL), PyQT, imgSeek, imgSeekCmd (updated), and imgSeekWeb-0.0.1_2.

I was able to successfully create the database by running

imgSeekCmd add -b ~/data/img-db.iqd  -r  -d ~/public_html/iswImage/images

from my command line. My problem is that according to the instructions pointing my browser to my site http://godskingsandheroes.info/~socrtwo/cgi-bin/imgSeekWeb.py should give me some results. Instead it just prints out the text of the script in Firefox. If I remove ~socrtwo, I get a 500 error. I did set http://godskingsandheroes.info/~socrtwo/cgi-bin/imgSeekWeb.py to 755 (CHMOD) with my hoster's file manager. However this did not seem to help.

In the instructions there are references to putting the lines in bashrc:

export PYTHONPATH=/usr/local/imgSeek/imgSeek-0.8.5/lib/python2.3/site-packages:$PYTHONPATH
export PATH=/usr/local/imgSeek/imgSeek-0.8.5/bin:$PATH
export PYTHONPATH=/usr/local/imgSeekWeb/lib/python2.3/site-packages:$PYTHONPATH

I'm betting this is the problem. I did run those lines from the command window with no obvious result. How would putting those lines in my bashrc script change the behaviour of a web browser? Should it not just change the behavior of the bash command line tool?

When I run [~/public_html/cgi-bin]# python imgSeekWeb.py from my Jail Shell command Window I get this error:

Traceback (most recent call last):
  File "imgSeekWeb.py", line 6, in ?
    from iswLib.IswSearch import *
ImportError: No module named iswLib.IswSearch

It appears not to be able to look in the Imgseeweb folder for iswLib.IswSearch. The file is there. I even change the name of the parent folder from imgSeekWeb-0.0.1_2 to imgSeekWeb-0.0.1, however this did not seem to help.

Here are my configurations of the imgseekweb.py as they stand now:

configUserParams = {
    "DBname" : "~/data/img-db.iqd",
    "HTMLThumbnailsURL" : "http://godskingsandheroes.info/~socrtwo/iswImage/thumbnails", 
    "IswThumbnailsDir" : "~/public_html/iswImage/thumbnails",
    "HTMLImageURL" : "http://godskingsandheroes.info/~socrtwo/iswImage/images",
    "IswImageDir" : "~/public_html/iswImage/images",
    "TmpImageDir" : "~/tmp"
}

All the folders exist. If I change "~" to "/home2/socrtwo/" which is what the full path appears to be from feedback from creating the .iqd database, it doers not help. Also removing ~socrtwo doesn't help in the http path in the configuration section.

Thanks for the help.

A: 

Is this running under apache? Is the "Options +ExecCGI" set on the cgi-bin directory? Is the python binary located at /usr/bin/python?

If it's just spitting back the text of the py file, that means it's not "executing" it. If it couldn't find the modules you'd get a 500 error.

Mark
Yes python2.4 is there.
socrtwo
Python and python@ are there.
socrtwo
+1  A: 

The problem is your webserver doesn't recognize the .py file as a CGI script to execute. It's just returning it like a text file. It has nothing to do with your import path issues; if you have problems there, you'll see them as 500 errors with (usually) a stack trace.

Your web server probably doesn't recognize that .py is a CGI type. You can rename your script to imgSeekWeb.cgi and it should work. Or you can add .py to the list of CGI extensions (details vary based on your web server). Also be sure the directory has permissions to run CGIs at all in the web server; you're probably OK if it's an existing cgi-bin directory.

Nelson
A: 

OK one problem is this on Python 2.4.3 installation. So I think I have to replace "2.3" with "2.4". This is a Linux hosting server apparently running Apache 2.2.11.

socrtwo
A: 

Why is the install instructions asking me to do anything with /usr/local/imgSeek/? There is no folder there named imgseek.

socrtwo
A: 

Apparently the real problem here was I am using Microsoft Expression Web as one of my authoring tools and I'm using it in a Windows environment. This formatting the Python scripts for Windows instead of UNIX. My hoster figured this out and he treated my file with dos2unix which installed in the shared environment and can be invoked from the command line at will by me for other files. As long as I treat a Python script with dos2unix and make it chmod 0755, even if I have edited in Microsoft Expression in a text mode, it will execute. That's why his test script worked fine until I edited it in my Windows environment.

socrtwo