PHP som cgi...
Jeg har et brugersystem, som kræver at php bliver kørt som cgi. Jeg bruger Apache, PHP3/4 og Windows 98:-(Når jeg kører scriptet får jeg denne fejl:
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, wex@wex.dk and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log."
Min httpd.conf, ser sådan ud:
##############START
ServerType standalone
ServerRoot "C:/Apache"
PidFile logs/httpd.pid
ScoreBoardFile logs/apache.status
ResourceConfig conf/srm.conf
AccessConfig conf/access.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 10
MaxSpareServers 50
StartServers 100
MaxClients 1000
MaxRequestsPerChild 0
Listen 80
Listen 198.168.100.1:80
BindAddress 198.168.100.1
Port 80
Listen 80
Listen 443
User nobody
Group nogroup
ServerAdmin root@something.com
ServerName 198.168.100.1
DocumentRoot "C:/Apache/htdocs"
<Directory />
Options FollowSymLinks ExecCGI
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "C:/Apache/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# UserDir public_html
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
# <Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
# Order deny,allow
# Deny from all
# </Limit>
# </Directory>
DirectoryIndex index.html index.htm index.phtml index.php index.php3 index.shtml
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
# UseCanonicalName On
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog logs/error.log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel error
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
CustomLog logs/access.log common
ServerSignature EMail
Alias /icons/ "C:/Apache/icons/"
<Directory "C:/Apache/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"
<Directory "C:/Apache/cgi-bin/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
IndexOptions FancyIndexing
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
AddDescription "GZIP compressed document" .gz
AddDescription "tar archive" .tar
AddDescription "GZIP compressed tar archive" .tgz
AddDescription "ZIP compressed archive" .zip
# OK in Linux
# ReadmeName readme.html readme.txt
# OK in Linux
# HeaderName header.html header.inc
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage en .en
AddLanguage da .da
LanguagePriority en da
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
AddType application/x-tar .tgz
AddHandler cgi-script .cgi .pl # .phtml
AddType text/html .shtml
AddHandler server-parsed .shtml
AddHandler send-as-is asis
AddHandler imap-file map
AddHandler type-map var
AddHandler cgi-script .phtml
AddHandler cgi-script .php3
AddHandler cgi-script .cgi
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from ."ændret"
</Location>
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from ."ændret"
</Location>
############ PROXY START
#<IfModule mod_proxy.c>
#ProxyRequests On
#<Directory proxy:*>
#Order deny,allow
#Deny from all
#Allow from ."ændret"
#</Directory>
#ProxyVia On
#CacheRoot "@@ServerRoot@@/proxy"
#CacheSize 5
#CacheGcInterval 4
#CacheMaxExpire 24
#CacheLastModifiedFactor 0.1
#CacheDefaultExpire 1
#NoCache a_domain.com another_domain.edu joes.garage_sale.com
#</IfModule>
############ PROXY SLUT
# '-S' to verify your virtual host
# If you want to use name-based virtual hosts you need to define at
# least one IP address (and port number) for them.
############ VIRTUALHOST START
# NameVirtualHost 198.168.100.2:80
# NameVirtualHost 198.168.100.2
# <VirtualHost 198.168.100.2>
# ServerAdmin root@something.com
# DocumentRoot /Apache/htdocs/mail
# ServerName 198.168.100.2
# ErrorLog logs/mail.log
# CustomLog logs/access.log common
# </VirtualHost>
# <VirtualHost _default_:80>
# </VirtualHost>
############ VIRTUALHOST SLUT
############ SSL START
<IfDefine SSL>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
</IfDefine>
<IfModule mod_ssl.c>
SSLPassPhraseDialog builtin
SSLSessionCache dbm:logs/ssl.scache
SSLSessionCacheTimeout 300
SSLMutex file:logs/ssl.mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLLog logs/ssl_engine.log
SSLLogLevel info
</IfModule>
<IfDefine SSL>
<VirtualHost _default_:443>
DocumentRoot "C:/Apache/htdocs"
ServerName 198.168.100.1
ServerAdmin root@something.com
ErrorLog logs/error.log
TransferLog logs/access.log
SSLEngine on
SSLCertificateFile /Apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /Apache/conf/ssl.key/server.key
<Files ~ "\.(cgi|shtml)$">
SSLOptions +StdEnvVars
</Files>
<Directory "C:/Apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
CustomLog logs/ssl_request.log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
</IfDefine>
############ SSL SLUT
############SLUT
cgi-scripts skal have endelsen .phtml..