Apache Web Serving with Jaguar, Part 2
Subject:   PHP and PERL mysteries
Date:   2005-09-19 20:59:38
From:   DickG
I placed IDENTICAL copies of a Perl script and a PHP script into the "/Library/WebServer/CGI-Executables" directory (aka ScriptAlias or /cgi-bin/), and the "/Users/DickG/Sites" directory. I made sure that both php4 and perl were activated in the "hpptd.conf" file, and I made sure all four scripts where executable (chmod 755). There aren't any .htaccess files.

When I access the scripts in ""
(or file.php), the php code works, but the perl code simply returns itself as text. When I access the scripts in "" (or file.php), the php script returns the dreaded "Premature end of script" message in the Apache error_log, but the perl script works properly.

What gives? Why don't they both execute the same in both places? Seems strange that I get success/failure with php, and failure/success with perl. I would have expected BOTH to succeed or BOTH to fail in each place, but not this mixture.

I'm running Mac OS X 10.3.9 with Safari 1.3.1 (v312.3). PHP is version 4.3.11.