Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CGI:SSI, exec no longer working

CGI:SSI, exec no longer working
Thread Tools
Zim
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status: Offline
Reply With Quote
May 6, 2004, 10:26 AM
 
I have a # of perl cgi scripts that need to include a set of header/footer files, some of which are php, so I can't just use a require statement.

I worked out a scheme using CGI:SSI to exec the files, just like a shtml directive. And this was working fine until "recently". Can't say for sure when it broke, but suddenly, these scripts no longer work. I get the error message

[an error occurred while processing this directive]

from the browser, as well as when running directly from the command line.

A sample file:
Code:
#!/usr/local/bin/perl $|++; sub header{ use CGI::SSI; use CGI::Carp (fatalsToBrowser); my $ssi = CGI::SSI->new(); print $ssi->exec(cgi => '/navjump_header.php'); # used to work, now fails print $ssi->exec(cgi => '/cgi-bin/perldiver.cgi'); # fails print $ssi->include(file => 'footer.pl'); # works } header(); 1;
so I would "require" this perl file, from another perl script.

The 1st exec is the one I _had_ working. The 2nd exec was just a debug idea, and perldiver runs fine from the command line. The 3rd include does work, so CGI::SSI it not totally broken, but...

I get nothing in the apache error log, nor in system log.

Other "variables"... I did install a wireless router over the weekend, and applies all Apple updates. But I can get to the web page, and have specified in my ipfw rules that 192.168. has full access to port 80. Oh, and the machine in in the DMZ for the router (I'm not at home so I can't check the router log, but in _theory_ the machine is exec'ing a local cgi, so....). I checked and the http.conf file has not changed in a month (seemingly no Apple "stealth" update in the recent updates)

Ideas?
Mike
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 6, 2004, 10:29 AM
 
have you restarted apache?
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Zim  (op)
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status: Offline
Reply With Quote
May 6, 2004, 11:03 AM
 
Yes.

And I guess this ia not Apache related(?) since it also fails when invoked from the Terminal? (maybe I should post this in unix instead)

Mike
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 6, 2004, 11:21 AM
 
did #!/usr/local/bin/perl previously work on that system?

have you tried with #!/usr/bin/perl instead?

[edit] okay, i read the script closer that time. i see the 2 files which don't work start with a slash, while the worker doesn't. have you played around with that?
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Zim  (op)
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status: Offline
Reply With Quote
May 6, 2004, 11:53 AM
 
Originally posted by philzilla:
did #!/usr/local/bin/perl previously work on that system?

have you tried with #!/usr/bin/perl instead?

[edit] okay, i read the script closer that time. i see the 2 files which don't work start with a slash, while the worker doesn't. have you played around with that?
Yep. Can't say for _sure_ that include and exec both assume the same starting path, but I figured that if include could find the one file, then exec should find the others. I tried with a slash, without, and with dot-slash.

And I verified that an shtml file doing the same thing (SSI exec via Apache) works. Something is wrong with my perl CGI::SSI.

Mike
(Last edited by Zim; May 6, 2004 at 12:01 PM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:29 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2