Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [linux] problem z instalacja php5
Forum PHP.pl > Forum > Serwery WWW > Apache
son
Witam,
Zainstalowałem apache 2.2 ze źródeł na suse 9.3 i działa. Teraz chciałem jeszcze zainstalować php5. Instaluje się bez błędnie, ale nie działa! Postępowałem zgodnie z instrukcją na wiki.

Kiedy wejdę na http://localhost widzę napis: "It works!" a kiedy próbuję odpalić plik o rozszerzeniu php w ogóle się nie uruchamia, tylko otwiera się okienko i pyta gdzie zapisać plik blink.gif

Wydaje mi się, że plik httpd.conf mam wporządku, ale może nie. Proszę o pomoc.
crash
Typowy problem z nieskonfigurowanym Apache'm, było o tym wiele razy. Odsyłam do wyszukiwarki.
son
Proszę o jakieś wskazówki bo szukałem już sad.gif nie wiem co robić. Podaj mi chociaż słowo kluczowe do wyszukiwarki smile.gif
Fo
hej,

zarzuć ino kawałek swojego httpd.conf dotyczący php.
php instalowane jako cgi czy modul ?

ahia i co to za pliczek, którego uruchamiasz ? jakaś prosta instrukcja czy co ?

jakby php działał to i tak powinieneś dostac jakiegoś parse errora.

pozdro,
Fo
son
/usr/local/apache2/conf/httpd.conf
Kod
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/foo.log".

ServerRoot "/usr/local/apache2"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>

User daemon
Group daemon
</IfModule>
</IfModule>

ServerAdmin hexadecimal@op.pl

DocumentRoot "/usr/local/apache2/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.  
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "/usr/local/apache2/htdocs">

    Options Indexes FollowSymLinks

    AllowOverride None

    Order allow,deny
    Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php index.htm
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>


ErrorLog logs/error_log


LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    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>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    #
    # 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

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog logs/access_log combined
</IfModule>

<IfModule alias_module>

    ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"

</IfModule>

<IfModule cgid_module>

</IfModule>

<Directory "/usr/local/apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>


DefaultType text/plain

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php5 .php5
    ScriptAlias /php/ "/usr/local/php5/bin/"
    Action application/x-httpd-php5 "/php/php"

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For files that include their own HTTP headers:
    #AddHandler send-as-is asis

    # For server-parsed imagemap files:
    #AddHandler imap-file map

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
</IfModule>


<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
crash
No a gdzie ładowanie modułu php?
son
No nie wiem ;] A jak to ma wyglądać? W instrucji instalacji na wiki nic takiego nie było...
dr_bonzo
Na wiki php5 jest ladowane jako CGI wiec nie ma tam ladowania modulu.
crash
Kod
LoadModule php5_module /path/to/libphp5.so
son
Zrobiłem tak jak piszesz, ale teraz apache się nie uruchamia sad.gif dostaje taki komunikat:
Kod
linux:~ # /usr/local/apache_2/bin/apachectl start
httpd: Syntax error on line 53 of /usr/local/apache_2/conf/httpd.conf: Cannot load /usr/local/apache_2/modules/libphp5.so into server: /usr/local/apache_2/modules/libphp5.so: undefined symbol: sqlite3DeleteTriggerStep
crash
Coś może spaćkałeś przy kompilacji PHP5 (czy może to był gotowiec z paczki?). Spróbuj wykompilować z tego obsługę sqllite.
son
Są to kompilowane źródła. Co ma do tego sqllite? Jaki mam użyć parametr żeby skopmipować php bez tego sqla?
edison
Ej, ludzie, a czemu w httpd.conf niema loadmodule i addmodule ?
U mnie (winxp apache 1.3.31) mam liste loadmodule i addmodule, a tutaj niema nic... może to jest wina tego ?
son
To już jest poprawione. W httpd.conf wpisałem:
Kod
LoadModule php5_module modules/libphp5.so

Tylko, że teraz dostaję komunikat o którym pisałem wyżej:
Kod
linux:~ # /usr/local/apache_2/bin/apachectl start
httpd: Syntax error on line 53 of /usr/local/apache_2/conf/httpd.conf: Cannot load /usr/local/apache_2/modules/libphp5.so into server: /usr/local/apache_2/modules/libphp5.so: undefined symbol: sqlite3DeleteTriggerStep

I teraz już w ogóle nie wiem o co biega :/
gremlin
W nawiązaniu do tematu.

Kompiluję apache2 z opcjami:

./configure --prefix=/usr/local/apache2 --enable-so (lub --enable-module=so) --enable-module=rewrite --enable-shared=rewrite

PHP5 z opcjami:

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apx2=/usr/local/apache2/bin/apxs --enable-track-vars --with-config-file-path=/usr/local/apache2/conf

Jaki jest powód tego że nie generuje mi się libphp5.so. Nie mogę go wtedy dopisać do httpd.conf bo go bie mam?? co jest nie tak
andriusza1
czesc, sorki że się podepnę podtemat. Ja również nie potrafię uruchomić tego php sad.gif Mam ubuntu , zainstlaowałem php5 + apache → dodałem ten wpis:
LoadModule php5_module modules/libphp5.so
ale po wpisaniu
sudo /usr/sbin/apachectl start
otrzymuje to:
Syntax error on line 197 of /etc/apache/httpd.conf:
Cannot load /etc/apache/modules/libphp5.so into server: /etc/apache/modules/libphp5.so: cannot open shared object file: No such file or directory
/usr/sbin/apachectl start: httpd could not be started
Może mi ktoś pomóc? Proszę
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.