Re: CGI script is in plain text

Discussion in 'Python' started by BMA TRADING, Jul 4, 2003.

  1. BMA TRADING

    BMA TRADING Guest

    On 3 Jul 2003 at 19:56, Ian Bicking wrote:

    > On Thu, 2003-07-03 at 15:39, A wrote:
    > > I have a webhosting account with one company.
    > > They have Apache running.
    > > When I start CGI script from a web browser, the result is plain text( the copy of that script)
    > > I can not access
    > > httpd.conf
    > > file so I changed
    > > .htaccess
    > > file. I put into it
    > >
    > > Options +ExecCGI
    > > Sethandler /usr/bin/python.exe .py

    >
    > Try renaming the file to .cgi -- as long as the #! line is right, it
    > doesn't matter the extension. Also, you may have to put the script in
    > the cgi-bin directory.
    >
    > Ian
    >

    Dear Ian,
    Thank you for your reply.
    I tried to rename it but it does NOT work.
    In the same directory I can successfully run Perl script( .pl extension) but no Python
    scripts.
    Any idea?
    Thanks
    Ladislav
    BMA TRADING, Jul 4, 2003
    #1
    1. Advertising

  2. BMA TRADING

    Alan Kennedy Guest

    BMA TRADING wrote:

    >>>> When I start CGI script from a web browser, the result is
    >>>> plain text( the copy of that script)

    ^^^^^^^^^^^^^^^^^^^^^^^

    D'oh! Missed that vitally important piece of the sentence. Sorry for
    having to follow-up my own post.

    Obviously, you're script is not being executed.

    The best way to debug a CGI installation is to place the "cgi.py"
    script itself in your own CGI directory. "cgi.py" is designed to be
    used for exactly this purpose, and will render a HTML page with
    valuable information about your python installation and web server
    environment.

    More importantly, "cgi.py" is a script that is *known* to work.

    Recommended steps:

    A. Find the installed location of the python on your system
    B. Copy "cgi.py" from the Lib directory of that installation
    C. Put it into your cgi-bin, or equivalent, directory.
    D. Make sure the path on the shebang line matches the path of A.
    E. Check that the necessary execute bits are set.
    F: Try this URL

    http://yourdomain.com/cgi-bin/cgi.py

    or equivalent.

    HTH,

    --
    alan kennedy
    -----------------------------------------------------
    check http headers here: http://xhaus.com/headers
    email alan: http://xhaus.com/mailto/alan
    Alan Kennedy, Jul 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. A
    Replies:
    0
    Views:
    281
  2. fatted
    Replies:
    1
    Views:
    128
    Steve Grazzini
    Jul 25, 2003
  3. Replies:
    3
    Views:
    212
    Gunnar Hjalmarsson
    May 24, 2006
  4. ich_bin_Ingenieur

    Perl CGI returning plain text HTML code

    ich_bin_Ingenieur, Mar 23, 2007, in forum: Perl Misc
    Replies:
    4
    Views:
    521
  5. kath
    Replies:
    4
    Views:
    573
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page