我在Windows 7 x64上运行Apache 2.2 32位服务器。我需要使用perl,所以我安装了Strawberry 5.12.3 32bit并配置了apache所以我有2个位置: primary - cgi only和secondary - with mod_perl。我的问题是我可以从辅助位置运行页面和脚本而没有任何问题,而主要位置生成500错误和错误日志条目说:
[Wed Dec 12 09:13:10 2012] [error] [client 127.0.0.1] (OS 193)%1 is not a valid win32 application. : couldn't create child process: 720193: login.pl
在Windows事件日志中,我有错误7001.控制台中的脚本运行正常。你知道出了什么问题吗?
这是我的Apache httpd.conf
ServerRoot "C:/Apache2_2"
PerlSetEnv NO_CACHE 1
PerlSetEnv DEBUG_SQL 1
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule perl_module modules/mod_perl.so
LoadFile "C:/strawberry/perl/bin/perl512.dll"
PerlSwitches -wT -IC:/home/kks/srv/bin
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
ThreadsPerChild 20
ServerAdmin me@me.pl
DocumentRoot "C:/Apache2_2/htdocs"
ErrorLog "|perl bin/pipedLogClient.pl -e"
LogLevel warn
SetEnv PERLDB_OPTS "RemotePort=localhost:9000"
SetEnv DBGP_IDEKEY "kks"
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "|perl bin/pipedLogClient.pl -a" common
</IfModule>
<IfModule alias_module>
Alias /primary/static/ "C:/home/kks/srv/bin/static/"
ScriptAlias /primary/ "C:/home/kks/srv/bin/"
#=== primary ===#
<Location "/primary/">
AllowOverride None
Options FollowSymLinks
Order allow,deny
Allow from all
</Location>
<Location "/primary/static/">
SetHandler default-handler
AllowOverride None
Options None
Order allow,deny
Allow from all
</Location>
Alias /secondary/static/ "C:/home/kks/srv/bin/static/"
ScriptAlias /secondary/ "C:/home/kks/srv/bin/"
<Location "/secondary/">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
PerlCleanupHandler owf_cleanup
Options FollowSymLinks
Options +ExecCGI
Order allow,deny
Allow from all
</Location>
<Location "/secondary/static/">
SetHandler default-handler
Options None
Order allow,deny
Allow from all
</Location>
</IfModule>
答案 0 :(得分:1)
检查login.pl中的shebang行并确保perl指向已安装草莓的路径