PHP7 & PHP5

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

PHP7 & PHP5

Postby andre lieske » 04. February 2019 06:36

Hallo Profis,
ich habe PHP 7.2.3 im Ordner "php" und PHP 5.5.38 im Ordner "php5.5.38" installiert.
Je nachdem welche Version ich benutze, ändere ich die "httpd-xampp.conf

# PHP-Module setup
#
#LoadFile "D:/xampp/php/php7ts.dll"
#LoadFile "D:/xampp/php/libpq.dll"
#LoadModule php7_module "D:/xampp/php/php7apache2_4.dll"

LoadFile "D:/xampp/php5.5.38/php5ts.dll"
LoadFile "D:/xampp/php5.5.38/libpq.dll"
LoadModule php5_module "D:/xampp/php5.5.38/php5apache2_4.dll"

Wenn ich PHP5 aktiviere, werden Scripte in meinem Projekt, die mit Endung .php5 nicht verarbeitet.
Habe ich eine Einstellung vergessen?
Kann ich das irgendwo einstellen?

Vielen Gank im voraus
Gruss André

Betriebssystem: WIN10 Prof
andre lieske
 
Posts: 39
Joined: 15. November 2011 07:03
Location: Berlin
XAMPP version: xampp-win32 & 64bit
Operating System: Windows 10 Prof.

Re: PHP7 & PHP5

Postby Altrea » 04. February 2019 07:50

Datei \xampp\apache\conf\extra\httpd-xampp.conf

Suche nach der Zeile <FilesMatch "\.php$">
Diese bestimmt welche Dateiendungen durch den PHP Interpreter gejagt werden.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: PHP7 & PHP5

Postby andre lieske » 04. February 2019 08:32

Hallo Altrea,
dort steht:
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

Was muss ich eintragen, dachte das Dollarzeichen ist eine variable auch für php5?
Gruss André

Betriebssystem: WIN10 Prof
andre lieske
 
Posts: 39
Joined: 15. November 2011 07:03
Location: Berlin
XAMPP version: xampp-win32 & 64bit
Operating System: Windows 10 Prof.

Re: PHP7 & PHP5

Postby Altrea » 04. February 2019 11:26

Nein, das Dollarzeichen kennzeichnet das Ende des Strings.
Es gibt mehrere Wege. Das regexp Wildcardzeichzen für ein beliebiges Zeichen wäre der Punkt (.).
Code: Select all
<FilesMatch "\.php.$">


Einfacher zu lesen wäre aber wahrscheinlich sowas
Code: Select all
<FilesMatch "\.(php|php5)$">


Du kannst aber auch sowas schreiben (Fragezeichen = Zeichen davor kommt 0-1 Mal vor)
Code: Select all
<FilesMatch "\.php5?$">



Neben der Zeile musst du zusätzlich auchnoch die folgende Zeile um die neue Dateierweiterung ergänzen
AddType text/html .php .phps .php5
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: PHP7 & PHP5

Postby andre lieske » 04. February 2019 16:54

Hallo Altrea,
vielen Dank, hat funktioniert.
Gruss André

Betriebssystem: WIN10 Prof
andre lieske
 
Posts: 39
Joined: 15. November 2011 07:03
Location: Berlin
XAMPP version: xampp-win32 & 64bit
Operating System: Windows 10 Prof.


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 47 guests