“Affichage du code PHP dans le navigateur” Réponses codées

PHP affichant le code dans le navigateur

If your PHP code is being displayed in the browser, it means that your
server has not been setup to serve PHP scripts.

You can use something like XAMPP. If you do, activate 'Apache' and 'MySQL'

After you do that, go into the download directory and go into 'htdocs'
(default: 'C:\xampp\htdocs')

Make a folder with your PHP code in it.

To access the website, go into your browser and type:

localhost/FOLDER_NAME_WITH_PHP_HERE

NOTE:
	this will only allow you to view it locally, nobody else will be able
    to see the website.
Hurt Hamster

Affichage du code PHP dans le navigateur

First your php or apache has been misconfigured not this was done on Ubuntu 22.04 LTS

First uninstall all php versions 
sudo apt purge php*

then install the lattest and other packages
sudo apt install php8.0-common php8.0-cli
sudo apt install php8.0
sudo apt install php

Check if it was installed successfully and version installed
php -v

Then restart apache2
sudo systemctl restart apache2

Then install other packages
sudo apt install php8.0 libapache2-mod-php8.0
sudo apt install php8.0-fpm libapache2-mod-fcgid
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.0-fpm
systemctl restart apache2
sudo apt install php-xml
sudo apt install php-mysqli
  
FINALLY RESTART apache2 and enjoy 
systemctl restart apache2

I HOPE THIS SOLVES YOUR PROBLEM
Vast Vicuña

Réponses similaires à “Affichage du code PHP dans le navigateur”

Questions similaires à “Affichage du code PHP dans le navigateur”

Plus de réponses similaires à “Affichage du code PHP dans le navigateur” dans PHP

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code