ubuntuusers.de

Apache läd falsche php version

Status: Gelöst | Ubuntu-Version: Server 22.04 (Jammy Jellyfish)
Antworten |

foxwebster

Anmeldungsdatum:
2. Dezember 2015

Beiträge: Zähle...

hallo

mein system ist ein ubuntu-server 22.04

habe folgendes problem: Apache ladet die falsche PHP-Version.

Statt wie in Apache-Module Konfiguriert ist PHP8.3 wird PHP8.1 geladen.

Siehe Grafiken in der Anlage.

Was kann das sein???

Bilder

micneu

Avatar von micneu

Anmeldungsdatum:
19. Januar 2021

Beiträge: 758

Wohnort: Hamburg

1. Für Text ausgaben bitte als code block
2. Bitte mal deinen Apache config. Die screenshots helfen mir jetzt nicht weiter

foxwebster

(Themenstarter)

Anmeldungsdatum:
2. Dezember 2015

Beiträge: 16

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#	/etc/apache2/
#	|-- apache2.conf
#	|	`--  ports.conf
#	|-- mods-enabled
#	|	|-- *.load
#	|	`-- *.conf
#	|-- conf-enabled
#	|	`-- *.conf
# 	`-- sites-enabled
#	 	`-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#

DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

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


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

#<Directory /srv/>
#	Options Indexes FollowSymLinks
#	AllowOverride None
#	Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
	Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
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

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

micneu

Avatar von micneu

Anmeldungsdatum:
19. Januar 2021

Beiträge: 758

Wohnort: Hamburg

Ich bin in Apache nicht so fit (meist nutze ich nginx), am besten Googles du mal wo in welcher config vom apache die Module konfiguriert werden (nicht in einer gui, sondern im Terminal. Ich konfiguriere meine webserver immer im Terminal) Mir ist auch noch nicht ganz klar in welchem programm du da das apache modul abgehackt hast, mir kommt der screenshot nicht bekannt vor.

Bitte ausgabe von:

  • dpkg -l | grep php

foxwebster

(Themenstarter)

Anmeldungsdatum:
2. Dezember 2015

Beiträge: 16

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ii  libapache2-mod-php                   2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
ii  libapache2-mod-php8.1                8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php8.3                8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-bz2                              2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          bzip2 module for PHP [default]
ii  php-common                           2:94+ubuntu22.04.1+deb.sury.org+2            all          Common files for PHP packages
ii  php-curl                             2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          CURL module for PHP [default]
ii  php-dompdf                           0.6.2+dfsg-3.1ubuntu0.1                      all          HTML to PDF converter
ii  php-font-lib                         0.3.1+dfsg-3.1                               all          read, parse, export and make subsets of different fonts
ii  php-fpm                              2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          server-side, HTML-embedded scripting language (FPM-CGI binary) (default)
ii  php-gd                               2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          GD module for PHP [default]
ii  php-google-recaptcha                 1.2.4-3                                      all          reCAPTCHA PHP client library
ii  php-json                             2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          JSON module for PHP [default]
ii  php-mariadb-mysql-kbs                1.2.12-1                                     all          Knowledge base about MariaDB and MySQL server variables
ii  php-mbstring                         2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          MBSTRING module for PHP [default]
ii  php-mysql                            2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          MySQL module for PHP [default]
ii  php-nikic-fast-route                 1.3.0-3                                      all          Fast request router for PHP
ii  php-phpmyadmin-motranslator          5.2.0-1build1                                all          translation API for PHP using Gettext MO files
ii  php-phpmyadmin-shapefile             2.1-5                                        all          translation API for PHP using Gettext MO files
ii  php-phpmyadmin-sql-parser            5.4.1-2                                      all          validating SQL lexer and parser
ii  php-phpseclib                        2.0.36-1                                     all          implementations of an arbitrary-precision integer arithmetic library
ii  php-psr-cache                        3.0.0-1                                      all          Common interface for caching libraries
ii  php-psr-container                    2.0.2-1                                      all          Common Container Interface (PHP FIG PSR-11)
ii  php-psr-log                          3.0.0-1                                      all          common interface for logging libraries
ii  php-symfony-cache                    5.4.4+dfsg-1ubuntu8                          all          provides an extended PSR-6, PSR-16 (and tags) implementation
ii  php-symfony-cache-contracts          2.4.0-1ubuntu2                               all          Generic abstractions related to caching
ii  php-symfony-config                   5.4.4+dfsg-1ubuntu8                          all          load configurations from different data sources
ii  php-symfony-dependency-injection     5.4.4+dfsg-1ubuntu8                          all          standardize and centralize construction of objects
ii  php-symfony-deprecation-contracts    2.4.0-1ubuntu2                               all          A generic function and convention to trigger deprecation notices
ii  php-symfony-expression-language      5.4.4+dfsg-1ubuntu8                          all          compile and evaluate expressions
ii  php-symfony-filesystem               5.4.4+dfsg-1ubuntu8                          all          basic filesystem utilities
ii  php-symfony-polyfill-php80           1.24.0-1ubuntu2                              all          Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
ii  php-symfony-polyfill-php81           1.24.0-1ubuntu2                              all          Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
ii  php-symfony-service-contracts        2.4.0-1ubuntu2                               all          Generic abstractions related to writing services
ii  php-symfony-var-exporter             5.4.4+dfsg-1ubuntu8                          all          export serializable PHP data structure to plain PHP code
ii  php-tcpdf                            6.4.4+dfsg1-1                                all          PHP class for generating PDF files on-the-fly
ii  php-twig                             3.3.8-2ubuntu4                               all          Flexible, fast, and secure template engine for PHP
ii  php-twig-i18n-extension              3.0.0-2                                      all          i18n extension for the Twig template system
ii  php-xml                              2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii  php-zip                              2:8.3+94+ubuntu22.04.1+deb.sury.org+2        all          Zip module for PHP [default]
ii  php8.1                               8.1.29-1+ubuntu22.04.1+deb.sury.org+1        all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.1-bz2                           8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        bzip2 module for PHP
ii  php8.1-cli                           8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        command-line interpreter for the PHP scripting language
ii  php8.1-common                        8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        documentation, examples and common module for PHP
ii  php8.1-curl                          8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        CURL module for PHP
ii  php8.1-fpm                           8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php8.1-gd                            8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        GD module for PHP
ii  php8.1-mbstring                      8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        MBSTRING module for PHP
ii  php8.1-mysql                         8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        MySQL module for PHP
ii  php8.1-opcache                       8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        Zend OpCache module for PHP
ii  php8.1-readline                      8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        readline module for PHP
ii  php8.1-xml                           8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php8.1-zip                           8.1.29-1+ubuntu22.04.1+deb.sury.org+1        amd64        Zip module for PHP
ii  php8.3                               8.3.9-1+ubuntu22.04.1+deb.sury.org+1         all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.3-apcu                          5.1.23-1+ubuntu22.04.1+deb.sury.org+1        amd64        APC User Cache for PHP
ii  php8.3-bcmath                        8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        Bcmath module for PHP
ii  php8.3-bz2                           8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        bzip2 module for PHP
ii  php8.3-cli                           8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        command-line interpreter for the PHP scripting language
ii  php8.3-common                        8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        documentation, examples and common module for PHP
ii  php8.3-curl                          8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        CURL module for PHP
ii  php8.3-fpm                           8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php8.3-gd                            8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        GD module for PHP
ii  php8.3-gmp                           8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        GMP module for PHP
ii  php8.3-igbinary                      3.2.15-1+ubuntu22.04.1+deb.sury.org+1        amd64        igbinary PHP serializer
ii  php8.3-imagick                       3.7.0-5+ubuntu22.04.1+deb.sury.org+1         amd64        Provides a wrapper to the ImageMagick library
ii  php8.3-intl                          8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        Internationalisation module for PHP
ii  php8.3-mbstring                      8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        MBSTRING module for PHP
ii  php8.3-mysql                         8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        MySQL module for PHP
ii  php8.3-opcache                       8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        Zend OpCache module for PHP
ii  php8.3-readline                      8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        readline module for PHP
ii  php8.3-redis                         6.0.2-1+ubuntu22.04.1+deb.sury.org+1         amd64        PHP extension for interfacing with Redis
ii  php8.3-xml                           8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php8.3-zip                           8.3.9-1+ubuntu22.04.1+deb.sury.org+1         amd64        Zip module for PHP
ii  phpmyadmin                           4:5.1.1+dfsg1-5ubuntu1                       all          MySQL web administration tool

micneu

Avatar von micneu

Anmeldungsdatum:
19. Januar 2021

Beiträge: 758

Wohnort: Hamburg

sieht für mich ein wenig viel aus. Nach welcher Anleitung bist du denn vorgegangen?

encbladexp Team-Icon

Ehemaliger
Avatar von encbladexp

Anmeldungsdatum:
16. Februar 2007

Beiträge: 17521

Du musst mit a2enmod das richtige mod php aktivieren, und mit a2dismod das falsche deaktivieren. Schau mal in /etc/apache/mods-enabled, dann siehst du was gerade aktiv ist.

Warum brauchst du eine abweichende PHP Version? 8.1 zu 8.3 ist doch sehr ueberschaubar was die Aenderungen angeht.

foxwebster

(Themenstarter)

Anmeldungsdatum:
2. Dezember 2015

Beiträge: 16

Hallo

das mit a2enmod hatte ich schon alles ausprobiert, mit dem gleichen ergebnis.

Hab den Server jetzt neu aufgesetzt, nur mit php8.3 jetzt klappt alles.

Antworten |