The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Broken CGI script since update

Discussion in 'General Discussion' started by wilfried, Jul 6, 2005.

  1. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    I have a custom cgi script to upload HTML to a SQL database.
    It has been working fine for 2 years.

    Since the last update (Release) it is broken.
    I get a Server Error 500 when I submit the HTML code via a form. If I remove the HTML and just enter a few letters of text it uploads just fine. So I am thinking it could be a security setting somewhere?

    Any one can help?
     
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Maybe, did you recently add mod_security?
     
  3. lankyb

    lankyb Well-Known Member

    Joined:
    Sep 21, 2004
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Peterborough, UK
    Have you looked at the error log: /usr/local/apache/logs/error_log

    It might give you a clearer indication why the script is not working.
     
  4. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    The full error is: Premature end of script headers: /path/to/script.cgi
     
  5. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    and in suexec_log I get "directory is writable by others" and "file has no execute permission"
    All permission are set fine tho.
    They haven't changed since it last worked :(
    I did try to re-set them, and set the 777 files to 755 but it did not help.
     
  6. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    So you changed the permissions on the files, but did you also change the folder to 755?
     
  7. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    yup I did.... Changing permission just broke everything else.

    I don't understand why a full html page won't upload thru the form but why a 4 letters word will....

    :(
     
  8. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    I was in a similar situation after today's upcp and things wouldn't work under proxied mod_perl and even same script as plain cgi (giving same premature .... error).

    http://forums.cpanel.net/showthread.php?t=41029

    Just dowgrade and see if it resolves your problem... though it could be something else also.

    Anup
     
  9. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    How do you downgrade DBD-mysql ?

    I did downgrade cPanel at some point but it did not help either....

    One thing I did the other day was to run /scripts/securetmp

    But I don't see how that would affect it?
     
  10. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    See if you have DBD-mysql-2.9008 in /home/.cpan/build

    perl Makefile.PL
    make
    make install

    if not then download from cpan

    and do the above and see if it helps.

    Anup
     
  11. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Running the file from bash I get this:

    Can't locate library/subs.cgi in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl
    /5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/pe
    rl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/l
    ib/perl5/5.8.0 .) at /home/path/to/script.cgi line 29.
     
  12. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    How do you download this from cpan? I have a newer version and it might be my problem...
     
  13. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Anup has told you how to do it. Do a search :rolleyes: Issues with DBD::mysql have been discussed at length on the forum in the last few days.
     
  14. gahelm

    gahelm Active Member

    Joined:
    Jun 21, 2003
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Florida
    I know DBD:mysql 3.000 has been discussed at length Chirpy, but has anyone fixed it? I've had my providers tech group on this to no avail. I've tried everything posted here and got no where. It's not causing me any real grief that I know of, but I hate to have errors showing up in the upcp log.
     
  15. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    go to http://search.cpan.org

    search DBD::Mysql

    Navigate to the list
    Download 2.9008
    tar--zxvf DBD-mysql-2.9008.tar.gz
    perl Makefile.PL
    make
    make install

    Most of the tech groups round the world have been failing with this and you can't blame them, it takes time to get to the cause. It took me two Hrs to get my stuff back to working stage (after 3.0000 broke almost everything on db based scripts (cgi/perl)) and the reasons of that hapening has been explained by the author (whioch i have already posted for info) when i contacted with the bug report. As mentioned, he is going to come with a fixed version (which is not 3.0001) soon

    Anup
     
  16. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    Hello Anup, fellow gmail user here.

    I appreciate you posting instructions but I am so inexperienced I fear there is a step left out.

    YOu say to download the older version of the tar but do not say where to upload it too? I can run pico OK as long as I know where the file is supposed to be placed.

    Please help.

    bob
     
  17. gahelm

    gahelm Active Member

    Joined:
    Jun 21, 2003
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Florida
    baidarkabob,

    You need to download it to a directory on your server. Then;

    tar--zxvf DBD-mysql-2.9008.tar.gz
    perl Makefile.PL
    make
    make install

    UPCP will still show errors in the morning because it will try to update again.....
     
  18. baidarkabob

    baidarkabob Well-Known Member

    Joined:
    Jan 12, 2003
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Alaska
    Thanks,

    So should change the upgrade config to manual for all categories?

    Thanks for the reply.

    bob
     
  19. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    Oh it's never safe to really have upcp set in auto mode. I switched it to manual right in the initial days when one such thing broke quite a few things.

    As for downloads, I have all my downloads in downloads directory ... easier to have all things organized in one directory :)

    Anup
     
    #19 anup123, Jul 7, 2005
    Last edited: Jul 7, 2005
  20. wilfried

    wilfried Active Member

    Joined:
    Aug 23, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Anup

    Thanks a lot, this fixed my problem too....

    Will it be fixed so we can re-upgrade at some point?
     
Loading...

Share This Page