Apache führt PHP nicht auf CentOS 7 im Browser aus

762
IMB

Ich habe folgendes installiert:

[root@localhost conf.d]# yum list installed | grep 'http' httpd.x86_64 2.4.6-80.el7.centos.1 @updates httpd-tools.x86_64 2.4.6-80.el7.centos.1 @updates [root@localhost conf.d]# yum list installed | grep 'php' php72.x86_64 1.0-1.el7.remi @remi-safe php72-php-cli.x86_64 7.2.11-1.el7.remi @remi-safe php72-php-common.x86_64 7.2.11-1.el7.remi @remi-safe php72-php-json.x86_64 7.2.11-1.el7.remi @remi-safe php72-runtime.x86_64 1.0-1.el7.remi @remi-safe 

PHP funktioniert bereits via CLI

[root@localhost conf.d]# php -v PHP 7.2.11 (cli) (built: Oct 10 2018 08:49:35) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies 

Apache funktioniert auch gut

[root@localhost modules]# httpd -v Server version: Apache/2.4.6 (CentOS) Server built: Jun 27 2018 13:48:59 

Meine Probleme sind, dass Apache PHP nicht ausführt und nur einen Download der PHP-Datei im Browser auslöst.

Hinweis: Dies ist bei Vagrant Running centos/7Box.

Irgendwelche Ideen?

0
Laden Sie PHP in `httpd.conf`? Zum Beispiel unter Windows `LoadModule php5_module" c: /wamp/bin/php/php5.5.12/php5apache2_4.dll "` DavidPostill vor 5 Jahren 0
Ich sehe diese Linie nicht. Tatsächlich zeigt "ls / etc / httpd / modules /" nichts über PHP. Es scheint, dass für Apache kein PHP-Modul installiert wurde. Irgendwelche Ideen, wie man es installiert? IMB vor 5 Jahren 0
Nicht wirklich. Ich benutze Windows nicht Linux. Und zur Vereinfachung [WAMP] (http://www.wampserver.com/de/) installiert. DavidPostill vor 5 Jahren 0

1 Antwort auf die Frage

0
IMB

Für diejenigen, die sich dafür interessieren, wird die Standardeinstellung offenbar php72nicht installiert mod_php.

php72-php sollte stattdessen verwendet werden.

Also habe ich nur einfach PHP neu installiert verwendet php72-phpanstelle von php72Apache und neu gestartet.

(Antwort gefunden unter https://serverfault.com/a/728663/75899 )