You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Phil Dibowitz <fo...@yahoo.com> on 2000/02/25 05:36:37 UTC

general/5808: (8)Exec format error upon exection of a script through apache (runs fine on command line)

>Number:         5808
>Category:       general
>Synopsis:       (8)Exec format error upon exection of a script through apache (runs fine on command line)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Thu Feb 24 20:40:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     foo_bar_00@yahoo.com
>Release:        1.3.9
>Organization:
apache
>Environment:
Redhat Linux 6.0 (all the errata and security updates, but original kernel: 2.2.5-15)
Intel i386 version (running on a Pentium)
gcc ver. 2.91.66
>Description:
I have a test PHP script that I'm trying to run as a cgi script (i.e., no php_mod... I have the appropriate AddType defined in srm.conf)... here's the bug...

If I run it from the command line (./test.php3) it executes just fine, but if I hit it with my browser Apache sends a page that says "no input selected." The log file then reports "(8)Exec format error"

The script is as the path to php, opening html headers and then the line:
<?php echo "test"; ?>

Executing on the command line results with "test"... but through Apache results in the error above.

I ran a backtrace on it and got:
Program received signal SIGINT, Interrupt
 0x4010fcf2 in __libc_accept ()
 #0 0x4010fcf2 in __libc_accpet ()
 #1 0x80701ae in strcpy ()
 #2 0x80705cc in strcpy ()
 #3 0x8070729 in strcpy ()
 #4 0x8070d56 in strcpy ()
 #5 0x80714d3 in strcpy ()
 #6 0x40079cb3 in __libc_start_main (main=0x807119c <strcpy+159240>,
 argc=4, argv=0xbffffd44, init=0x8049ab4, fini=0x80a511c <__udivdi3+460>,
 rtld_fini=0x4000a350<_dl_fini, stack_end=0xbffffd3c)
 at ../sysdeps/generic/libc-start.c:78

NOTE: My web hosting company uses php as a cgi script with no mod_php, and I'm trying to mirror that at home. That's how I know it's possible.
>How-To-Repeat:
1. Here's my test script test.php3 (only I have opening and closing HTML and BODY tags)...

#!/usr/local/bin/apache
<php? 
echo "test"; 
?>

2. In srm.conf set:
AddType cgi-script .php3

3. Put the above script in your cgi-bin directory five it execute permissions and hit it with your browser.
>Fix:
I know it's possible to use this type of setup, but I have no idea why I'm getting a SEGINT, so not sure how to fix it...
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]