writing captcha image file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amaltasb@gmail.com

    writing captcha image file

    I have a script which generates captcha file on
    /usr/local/apache/htdocs/captcha directory. The script is working fine
    when i execute it from terminal>[color=blue]
    >/usr/local/bin/python generateCaptcha .cgi > and it writes to /htdocs/captcha directory[/color]

    but when I execute the script through
    http://www.mydomain.com/cgi-bin/generateCaptcha.cgi its failing at
    im.save(file_na me, 'JPEG')

    I changed the permissions to 755.

    Can anyone help me...

    Thanks

  • amaltasb@gmail.com

    #2
    Re: writing captcha image file

    I get this msg:
    Traceback (most recent call last):
    File "/usr/local/apache/cgi-bin/newuser.cgi", line 61, in ?
    cstatus = im.save(file_na me,'JPEG')
    File "/usr/local/lib/python2.4/PIL/Image.py", line 1299, in save
    fp = __builtin__.ope n(fp, "wb")
    IOError: [Errno 13] Permission denied:
    '/usr/local/apache/htdocs/captcha/t13uum15a2jgfj2 sqg.jpg'

    Comment

    • Fredrik Lundh

      #3
      Re: writing captcha image file

      amaltasb@gmail. com wrote:
      [color=blue]
      > I get this msg:
      > Traceback (most recent call last):
      > File "/usr/local/apache/cgi-bin/newuser.cgi", line 61, in ?
      > cstatus = im.save(file_na me,'JPEG')
      > File "/usr/local/lib/python2.4/PIL/Image.py", line 1299, in save
      > fp = __builtin__.ope n(fp, "wb")
      > IOError: [Errno 13] Permission denied:
      > '/usr/local/apache/htdocs/captcha/t13uum15a2jgfj2 sqg.jpg'[/color]

      that means exactly what it says: the user account that your CGI script
      is running under is not allowed to write to that directory.

      this is a Unix/Apache configuration issue, not really a Python issue. see
      this apache FAQ entry for some additional info:



      </F>



      Comment

      • amaltasb@gmail.com

        #4
        Re: writing captcha image file

        I changed the owner of the file to root using chown root newuser.cgi,
        but still i m not able to write...

        Comment

        • Fredrik Lundh

          #5
          Re: writing captcha image file

          amaltasb@gmail. com wrote:
          [color=blue]
          > I changed the owner of the file to root using chown root newuser.cgi,
          > but still i m not able to write...[/color]

          have you tried asking in a unix or apache forum, or do you expect
          pythoneers to help you with all your computer-related problems ?

          </F>



          Comment

          • John Draper

            #6
            Re: writing captcha image file

            amaltasb@gmail. com wrote:
            [color=blue]
            >I changed the owner of the file to root using chown root newuser.cgi,
            >but still i m not able to write...
            >
            >
            >[/color]
            Are you running Apache in Chrooted mode? If so, then that might be your
            problem.

            John

            Comment

            Working...