PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [Ubuntu 9.10]apache2 + php = leere Webseite



Herakles
25.01.10, 11:09
Moin!

Ich habe Problem mit einer php5-Installation. Ich habe einen Ubuntu 9.10 Server installiert und meine bisher installierten Dienste (samba, sshd) funktionieren auch einwandfrei.

Nun möchte ich gern ein Mediawiki installieren, wofür ich grundlegenderweise erstmal einen Apache und php benötige. Also habe ich die notwendigen Dinge wie folgt installiert:



# apt-get install apache2
# apt-get install php
# apt-get install libapache2-mod-php5


Die php.ini sieht wie folgt so aus, wie unten angehängt, hier im Text ist mir das zu viel und würde alles unübersichtlich machen.

Mein Problem ist nun, dass eine weiße Seite im Browser erscheint (Qeullcode ebenfalls vollkommen leer), sobald ich eine solche index.html in /var/www ablege:



# cat /var/www/index.html
<html>
<head>
<title> PHP Test Script </title>
</head>
<body>
<?php
phpinfo( );
?>
</body>
</html>


Ich habe schon in dem Forum gesucht, dabei in diesem Thread (http://www.linuxforen.de/forums/showthread.php?t=222084&highlight=php+leer) ein ähnliches Problem, aber keine Lösung für mein Problem gefunden.

Hat jemand noch eine Idee, was ich falsch gemacht haben könnte? Ich versuche das jetzt schon seti 3 Tage und bekomme es einfach nicht hin. Zur Installation des mediawikis bin ich also noch gar nicht vorgedrungen, weil es offenbar(?) schon an php scheitert...

Viele Grüße,
Herakles

Hier noch die php.ini: GRRRRRR! Zuviele Zeichen. Ich habe sie mal eingestampft auf alle aktivierten Zeilen :) :



# cat /etc/php5/apache2/php.ini
[PHP]
engine = On
zend.ze1_compatibility_mode = Off
short_open_tag = On
asp_tags = Off
precision = 12
y2k_compliance = On
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = On
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
error_reporting = E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
variables_order = "EGPCS"
register_globals = Off
register_long_arrays = On
register_argc_argv = On
auto_globals_jit = On
post_max_size = 8M
magic_quotes_gpc = On
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 8M
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
extension=mysql.so
[Date]
[iconv]
[sqlite]
[Pcre]
[Syslog]
define_syslog_variables = Off
[mail function]
SMTP = localhost
smtp_port = 25
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mSQL]
msql.allow_persistent = On
msql.max_persistent = -1
msql.max_links = -1
[OCI8]
[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase]
sybase.allow_persistent = On
sybase.max_persistent = -1
sybase.max_links = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Informix]
ifx.default_host =
ifx.default_password =
ifx.allow_persistent = On
ifx.max_persistent = -1
ifx.max_links = -1
ifx.textasvarchar = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.blobinfile = 0
ifx.nullformat = 0
[Session]
session.save_handler = files
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 4
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldse t="
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[mbstring]
[FrontBase]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400

marce
25.01.10, 11:12
ich würde erst mal in der Apache-Konfig nachschauen, was er denn lt. dieser mit *.html-Dateien tun soll.

Herakles
25.01.10, 12:37
Die apache2.conf sagt das hier:



cat apache2.conf | grep -v "#"
ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_event_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
DefaultType text/plain
HostnameLookups Off
ErrorLog /var/log/apache2/error.log
LogLevel warn
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/httpd.conf
Include /etc/apache2/ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
Include /etc/apache2/conf.d/
Include /etc/apache2/sites-enabled/


Die ports.conf ist wie folgt (httpd.conf ist leer):



# cat ports.conf
NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
Listen 443
</IfModule>


Enabled in mods-enabled sind diese module:



alias.conf authz_user.load dir.load php5.load
alias.load autoindex.conf env.load setenvif.conf
auth_basic.load autoindex.load mime.conf setenvif.load
authn_file.load cgi.load mime.load status.conf
authz_default.load deflate.conf negotiation.conf status.load
authz_groupfile.load deflate.load negotiation.load
authz_host.load dir.conf php5.conf


Da erscheint mir die php5.conf interessant:



<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>


Und da ist auch schon der Hund begraben! Neuer Code:



<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3 .html
AddType application/x-httpd-php-source .phps
</IfModule>


Jetzt funktioniert's!

Danke!

marce
25.01.10, 12:39
Ich würde mir diese Lösung gut überlegen - vor allem, wenn Du viele html-Dateien hast, die eben _kein_ PHP-Code beeinhalten. So geht nämlich jede *.html-Datei auch durch den PHP-Parser und das kann die Auslieferung und Serverlast durchaus nachhaltig beeinflussen...

So möglich - packe PHP in ded. *.php-Datein...