PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : apache2 und php5



shb
06.08.04, 09:46
hi all, ich hab apsche2 als rpm und php5 als src und beides funzt auch nur nicht zusammen ;( ich habe mir die anleitung von http://de.php.net/manual/de/install.apache2.php reingezogen und diese zeile in meiner httpd2.conf hinzugefühgt:
LoadModule php5_module libexec/libphp5.so leider erhalte ich beim (neu)starten des apaches diesen fehler:
Starting httpd2: Syntax error on line 59 of /etc/httpd/conf/httpd2.conf: Cannot load /etc/httpd/2.0/libexec/libphp5.so into server: /etc/httpd/2.0/libexec/libphp5.so: cannot open shared object file: No such file or directory
die datei libphp5.so hab ich auch nigends auf meiner kiste gefunden.

wie krieg ich php5 nun ordentlich zum laufen?
kann mir jemand helfen?

cu SHB

shb
06.08.04, 10:00
hab mal weiter gesucht ich muss das hier beim configure hinzufühgen --with-apxs2=/usr/
local/apache2/bin/apxs
aber ich hab diese verzeichnis nicht ;(
und auch überhaupt kein apxs
was muss ich noch installieren

cu SHB

dekadent
06.08.04, 10:23
wenn du es dir etwas einfacher machen willst nutze XAMPP von www.apachefriends.org - da ist alles drin und funktioniert wunderbar.

Allerdings kann es auch schön sein ein Problem zu verstehen und zu beheben :)





die gesuchte *php*.so Datei sollte eigentlich mit php5 installiert worden sein, vielleicht hast du sie nicht in das gewünschte Verzeichnis verschoben?

Figapu
06.08.04, 10:24
Oder compile den Apache auch aus den Original Sourcen.

shb
06.08.04, 10:51
Ja hab ich gemacht mit den parametern
./configure --enable-so
php hab ich mit den parameter kompiliert
./configure --with-mysql --enable-sockets --with-apxs2=/usr/local/apache2/bin/apxs

dann hab ich die zeile in die httpd.con eingetragen
LoadModule php5_module lib/libphp5.so
und die datei mit
cp /usr/local/apache2/modules/libphp5.so /etc/httpd/2.0/lib/ kopiert und den apache neu gestartet
wenn ich in meinem auf localhost gehe öffnet er mir eine start seite gebe ich alerding localhost/test3.php ein tut sich nix, obwohl die datei vorhanden ist bei html datein das selbe. gebe ich allerdings eine datei an die nicht vorhanden ist gibt er auch die meldung aus, dass er die seite nicht gefunden hat.

cu SHB

dekadent
06.08.04, 11:10
LoadModule php5_module modules/libphp5.so


das steht bei mir und die Datei liegt im apache Ordner im Unterverzeichnis "modules" - also quasi da wo du sie rauskopiert hast.

da du "cp" benutzt hast ist sie ja noch da, schreib also einfach mal den Eintrag in die httpd.conf den ich dort oben habe. Ach ja und Apache neustarten :)

shb
06.08.04, 11:30
Starting httpd2: Syntax error on line 61 of /etc/httpd/conf/httpd2.conf:
Cannot load /etc/httpd/2.0/modules/libphp5.so into server: /etc/httpd/2.0/modules/libphp5.so: cannot open shared object file: No such file or directory

diese meldung erhalte ich nachdem ich den pfad geändert habe (soll heißen nun startet der apache nicht mehr).
html seiten macht er wieder und wenn ich php seiten öffen, will er sie downloaden
hier ist mal meine config

cat /etc/httpd/conf/httpd2.conf
### Main Configuration Section
### You really shouldn't change these settings unless you're a guru
###
ServerRoot /etc/httpd/2.0
#ServerName localhost
#LockFile /etc/httpd/httpd.lock
PidFile /var/run/httpd.pid
ErrorLog logs/error_log
LogLevel warn
DocumentRoot /var/www/html


### Dynamic Shared Object (DSO) Support
###
### You should always leave those three, as they are needed for
### normal use.
### mod_access (Order, Allow, etc..)
### mod_log_config (Transferlog, etc..)
### mod_mime (AddType, etc...)

LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
##LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
##LoadModule charset_lite_module modules/mod_charset_lite.so
##LoadModule case_filter_module modules/mod_case_filter.so
##LoadModule case_filter_in_module modules/mod_case_filter_in.so
##LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
##LoadModule log_forensic_module /usr/lib/apache2/mod_log_forensic.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
##LoadModule mime_magic_module modules/mod_mime_magic.so
##LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
##LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
##LoadModule cgid_module modules/mod_cgid.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
##LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
###PHP5
AddType application/x-httpd-php .php .phtml
LoadModule php5_module lib/libphp5.so
#LoadModule php5_module modules/libphp5.so
#LoadModule php5_module libexec/libphp5.so

###
### Global Configuration
###
# We now support multiple apache configurations on the same server. In
# common.conf, we put all directives that are common to all implementations
# (httpd, httpd-perl, etc.)
# For Apache2 we load all conf files in conf.d
Include /etc/httpd/conf.d/*.conf
Include conf/commonhttpd.conf


###
### IP Address/Port and Proxied configuration section
###
# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
# the fast web server serves static content while Apache handles the
# cgi or php files

#BindAddress *
<IfDefine APACHEPROXIED>
Listen 8080
</IfDefine>
<IfDefine !APACHEPROXIED>
Listen 80
</IfDefine>

# Likewise, we can set apache as the server by default and send perl
# requests via ProxyPass to apache-mod_perl. It increases performance
# since the perl interpreter is only used for perl and the standard apache
# does all the html and image files, with a smaller footprint.
#
# If you install apache and apache-mod_perl, this is the default config.
# If you don't want two web servers to use perl, uninstall apache, and
# apache-mod_perl will not be proxied.

<IfDefine PERLPROXIED>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^proxy:.* - [F]
RewriteRule ^(.*\/perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
RewriteRule ^(.*\/cgi-perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
</IfModule>
</IfDefine>

###
### Log configuration Section
###

<IfModule mod_log_config.c>
#Single logfile with access, agent and referer information
#This is the default, if vlogs are not defined for the main server
CustomLog logs/access_log combined env=!VLOG
#If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry
CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG
</IfModule>

###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/Vhosts.conf
#Include conf/vhosts/DynamicVhosts.conf
#Include conf/vhosts/VirtualHomePages.conf


###
### Performance settings Section
###
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15


# prefork MPM [THIS IS THE DEFAULT]
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# perchild MPM
# NumServers: constant number of server processes
# StartThreads: initial number of worker threads in each server process
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# MaxThreadsPerChild: maximum number of worker threads in each server process
# MaxRequestsPerChild: maximum number of connections per server process
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>

dekadent
06.08.04, 12:39
###
ServerRoot /etc/httpd/2.0

ändere den mal in dein apache verzeichnis

und dann

LoadModule php5_module lib/libphp5.so
#LoadModule php5_module modules/libphp5.so

da wieder die untere aktivieren!

nochmal zru nachfrage, apache hast du über rpm oder tar.gz installiert?

shb
06.08.04, 12:47
in was soll ich den server root ändern?
wenn ich die zeile rausnehme geht php zwar wieder aber nur die 4.3.8
erst habe ich den apache als rpm installiert und nun selber kompiliert

cu SHB

dekadent
06.08.04, 12:55
/usr/local/apache2/


da sollte dein apache sein (du startest ja auch über /usr/local/apache2/bin/apachect1 start)


also muss das auch die Serverroot sein.
also muss der Pfad zur libphp5.so folgendermaßen lauten:

LoadModule php5_module modules/libphp5.so

weil es im Verzeichnis

/usr/local/apache2/modules/libphp5.so

liegt (da hast du die ja irgendwohin kopiert)



dadurch das deine serverroot aber anders lautet, sucht er in nem anderen verzeichnis.

shb
06.08.04, 13:21
wenn ich den server root ändere kann er ein haufen von modulen nicht finden und demzufolge nicht laden, die liegen ja alle in dem anderen server root
soll ich die einfach kopieren?

cu SHB

dekadent
09.08.04, 13:22
mir scheints als ob du zwei apache drin hast... es sollte eigentliches alles im pfad /usr/local/apace2 liegen. naja kopieren kannst du mal testen.

fontajos
18.08.04, 20:21
PHP5 mit Apache2 auf SuSE Linux 9.1 installieren - Anleitung
----------------------------------------------------------

PHP5 herunterladen und auspacken (z.B. mit tar xfz php-5.0.1.tar.gz)

Ins PHP-Verzeichnis wechseln (cd php-5.0.1)

PHP Configure starten

./configure --prefix=/usr/local/php5 --with-apxs2=/usr/sbin/apxs2 --with-libxml-dir=/usr/lib --with-zlib --with-zlib-dir=/usr/lib --with-mysql=/usr/bin/mysql --with-gd --enable-soap --enable-sockets --with-gettext=/usr/bin/gettext

PHP kompilieren

make

Installation vorbereiten

cp /etc/apache2/sysconfig.d/loadmodule.conf /etc/apache2/httpd2-prefork.conf (nur, damit die make_install Routine durchläuft)

make install

Apache mitteilen, dass PHP5 verwendet werden soll

pico -w /etc/sysconfig/apache2

Hier die Zeile mit den zu benutzenden Modulen anpassen

APACHE_MODULES="suexec access actions ... php4" wird zu:
APACHE_MODULES="suexec access actions ... php5"

Apache2 neu starten

/etc/init.d/apache2 stop
/etc/init.d/apache2 start


Dann klappts auch mit dem lieben Nachbarn ;-)

Gruss

José
Entwickler PhPepperShop