Page 1 of 1

apt-get apache und php

Posted: 2006-02-27 00:10
by thomas.km
Guten Tag,

habe mir jetzt bei meinem Testsystem php und Apache installiert(Apache 2 und php4)

Aufruf:

apt-get install apache2 php4 phpmyadmin
brachte mir:
The following NEW packages will be installed:
apache-common apache2 apache2-common apache2-mpm-worker apache2-utils libapache-mod-php4 libapr0 libexpat1 libkrb53
libmysqlclient12 libzzip-0-12 mysql-common openssl php4 php4-common php4-mysql phpmyadmin ssl-cert ucf


Allerdings wurde php in keinsterweise in den apache eingebaut.
Immer wenn ich php Seiten aufrufe, will er das file runterladen, also interpretiert es nicht.

Nun wollte ich php als Modul laden aber so wie ich das von Suse her kenne (mod_php) geht es nicht. Da ich nicht das Modul dafür finde (z.b. usr/lib/apache2/modules)

Kann mir wer helfen?
Das Howto mit FastCgi Php4/5 ist sicher toll, aber das ist noch too much für den Anfang, ich will einfach nur ganz altmodisch erstmal php4 als Modul laufen lassen.

Habe ich was vergessen zu installieren oder ist es bei Debian grundlegend anders?

Grüsse
Thomas

Re: apt-get apache und php

Posted: 2006-02-27 00:26
by Roger Wilco
thomas.km wrote:Habe ich was vergessen zu installieren oder ist es bei Debian grundlegend anders?
Du hast vergessen, das Modul in den Apache einzubinden. man a2enmod

Re: apt-get apache und php

Posted: 2006-02-27 00:28
by thomas.km
Habe mich ans Manual von libapache gehalten

To use php4-cgi with apache2
1) activate CGI (it's on by default in default debian setups)
a) If using the prefork MPM, use 'a2enmod cgi'
b) If using a threaded MPM, use 'a2enmod cgid'
2) activate mod_actions (a2enmod actions)
3) Add the following to a config snippet in /etc/apache2/conf.d
<IfModule mod_actions.c>
Action application/x-httpd-php /cgi-bin/php4
</IfModule>


das ist passiert...trotzdem geht es nicht.

Re: apt-get apache und php

Posted: 2006-02-27 00:35
by Roger Wilco
Du hast php4-cgi nach der Ausgabe von apt-get auch nicht installiert. :roll:

Re: apt-get apache und php

Posted: 2006-02-27 00:36
by thomas.km
The following NEW packages will be installed:
php4-cgi php4-cli

nachgeholt.

Muss ich nun noch was konfigurieren? a2enmod habe ich das entsprechende ja aktiviert, leider tut sich da noch immer nichts.

Re: apt-get apache und php

Posted: 2006-02-27 00:41
by Roger Wilco
Dir fehlt noch ein Handler für die definierte Action. In deinem ersten Beitrag hast du allerdings noch geschrieben, du wolltest PHP als Apache-Modul einsetzen.

Re: apt-get apache und php

Posted: 2006-02-27 00:44
by thomas.km
Wie soll der aussehen?

<IfModule mod_actions.c>
Action application/x-httpd-php /cgi-bin/php4
</IfModule>

So ist es im doc von php4-cgi beschrieben.

Re: apt-get apache und php

Posted: 2006-02-27 00:49
by Roger Wilco

Re: apt-get apache und php

Posted: 2006-02-27 00:51
by thomas.km
also einfach

AddHandler cgi-script .cgi .php

in die apache2.conf?

EDIT: funzt leider auch nicht.

Weitere Ideen was ich noch vergessen haben könnte?

Re: apt-get apache und php

Posted: 2006-02-27 09:21
by thomas.km
Oder kann mir jemand sagen wie ich php einfach als Modul einbinde?
man a2enmod bringt genau 5 zeilen die mir einfach nur sagen, das ich was aktivieren kann.

Wie heißt das php Modul für Debian und wie binde ich es ein?
libapache-mod-php hatte ich installiert, aber in der readme steht nur wieder was von php-cgi

grr :-//

Re: apt-get apache und php

Posted: 2006-02-27 10:21
by aubergine
Wenn man Apache2 nutzt sollte man auch die Pakete dafür installieren :roll:

Code: Select all

apt-get install libapache2-mod-php4
Dann gehst du in die apache2.conf

Code: Select all

#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
Da machst du die # vorne dran weg.

Code: Select all

apache2ctl restart
Und gesetzt dem Fall du hast die Dinge wie oben beschrieben ansatzweise richtig gemacht, bekommste nun was du willst...


Viel Glück und PS lesen bildet

Re: apt-get apache und php

Posted: 2006-02-27 10:50
by thomas.km
apt-get install libapache2-mod-php4

The following NEW packages will be installed:
apache2-mpm-prefork libapache2-mod-php4




ls -l /etc/apache2/mods-enabled/
total 0
lrwxrwxrwx 1 root root 40 Feb 26 23:59 actions.load -> /etc/apache2/mods-available/actions.load
lrwxrwxrwx 1 root root 36 Feb 26 23:59 cgi.load -> /etc/apache2/mods-available/cgi.load
lrwxrwxrwx 1 root root 37 Feb 27 10:44 php4.conf -> /etc/apache2/mods-available/php4.conf
lrwxrwxrwx 1 root root 37 Feb 27 10:44 php4.load -> /etc/apache2/mods-available/php4.load
lrwxrwxrwx 1 root root 40 Feb 26 23:59 userdir.conf -> /etc/apache2/mods-available/userdir.conf
lrwxrwxrwx 1 root root 40 Feb 26 23:59 userdir.load -> /etc/apache2/mods-available/userdir.load


apache2.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


und dann restarted.

Geht immer noch nicht :-/

Was könnte es noch sein?

Re: apt-get apache und php

Posted: 2006-02-27 11:03
by aubergine
Nehme mal die Standard apache2.conf wieder her und editiere wie oben beschrieben.

Re: apt-get apache und php

Posted: 2006-02-27 11:37
by thomas.km
hat auch nichts gebracht.

Ich habe jetzt das howto von debianhowto.de für fastcgi verwendet.

PHP5

Leider kommt wenn ich phpmyadmin aufrufen will:
Cannot load session extension. Please check your PHP configuration.

Google bringt dazu session.save_path
Da habe ich das ; in der php.ini weggenommen. Geht trotzdem nicht.

Dann habe ich die Einstellung von http://de2.php.net/session genommen.
Gleicher Fehler.
Dann habe ich die Einstellungen von
http://www.rootforum.org/forum/viewtopic.php?t=36346
genommen
Geht auch nicht.
Alle anderen PHP scripte laufen, aber in phpmyadmin komme ich nicht rein.

Re: apt-get apache und php

Posted: 2006-02-27 12:01
by aubergine

Code: Select all

apt-get install libapache2-mod-auth-mysql
apt-get install php4-mysql
apache2ctl restart

Re: apt-get apache und php

Posted: 2006-02-27 12:04
by thomas.km
The following NEW packages will be installed:
libapache2-mod-auth-mysql
war ok

bei
apt-get install php4-mysql

Will er wieder apache1 drüber bügeln. Wie umgehe ich das?

apt-get install php4-mysql
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
apache-common libapache-mod-php4 libzzip-0-12 php4-common
Suggested packages:
apache apache-ssl apache-perl php4-pear
The following NEW packages will be installed:
apache-common libapache-mod-php4 libzzip-0-12 php4-common php4-mysql


Das 2. apt-get install habe ich jetzt mal noch nicht ausgeführt.

EDIT: ich habe php5 installiert, ist da php4-mysql richtig?

Re: apt-get apache und php

Posted: 2006-02-27 12:08
by aubergine
Schreib mal in die sources List:

Code: Select all

# deb http://people.debian.org/~dexter php5.0 sarge
# deb-src http://people.debian.org/~dexter php5.0 sarge
deb http://security.debian.org/ sarge/updates main contrib non-free 
deb ftp://ftp.rz.uni-wuerzburg.de/pub/linux/debian/    sarge main non-free contrib 
deb     ftp://ftp.uni-erlangen.de/pub/Linux/debian/    sarge main non-free contrib 
deb-src ftp://ftp.uni-erlangen.de/pub/Linux/debian/    sarge main non-free contrib

Code: Select all

apt-get update && apt-get upgrade

Re: apt-get apache und php

Posted: 2006-02-27 12:08
by thomas.km
habe jetzt
apt-get install php5-mysql
Reading Package Lists... Done
Building Dependency Tree... Done
Note, selecting php5.0-mysql instead of php5-mysql
The following NEW packages will be installed:
php5.0-mysql
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.


installiert.

Leider bleibt der Fehler mit den
Cannot load session extension. Please check your PHP configuration.

session.save_path ist aktiv.

Re: apt-get apache und php

Posted: 2006-02-27 12:18
by aubergine
Dir ist schon bewusst das du php4 installiert hast?

Re: apt-get apache und php

Posted: 2006-02-27 12:21
by thomas.km
??

ich habe doch geschrieben das ich nach dem Howto von debianhowto.de vorgangen bin (heute) und PHP5 mit fast-cgi installiert habe

php-fcgi -v
PHP 5.0.5-Debian-0.8~sarge1 (cgi-fcgi) (built: Oct 27 2005 11:00:09) (Debian GNU/Linux)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies

Re: apt-get apache und php

Posted: 2006-02-27 12:53
by thomas.km
cat grep session* /etc/php5.0/fcgi/php.ini

session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 4
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cookie_domain =
session.serialize_handler = php
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.save_path = ""
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 1
session.cookie_lifetime = 0
session.cookie_path = /
session.save_handler = files