Search
 
SCRIPT & CODE EXAMPLE
 

PHP

showing php code in browser

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
Comment

php showing code in browser

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:xampphtdocs')

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.
Comment

PREVIOUS NEXT
Code Example
Php :: php add to array in loop 
Php :: where not null in laravel 
Php :: capitalize php 
Php :: php imap install 
Php :: how to add property to an object in php 
Php :: php echo array 
Php :: create laravel 9 auth 
Php :: twig filter line break 
Php :: get full current url in laravel 
Php :: return view controller laravel 
Php :: array_unique multidimensional php 
Php :: wp create user programmatically 
Php :: wordpress get permalink taxonomy id 
Php :: laravel in array blade 
Php :: ubuntu install php 8 mysql 
Php :: PHP time limit (max_execution_time): 
Php :: increase memory limit wordpress 
Php :: php money_format currency symbol 
Php :: delete after 30 days in php 
Php :: pre function for PHP 
Php :: PHP substr_count — Count the number of substring occurrences 
Php :: only display part of string php 
Php :: validation error message in laravel 
Php :: wordpress get attachment url by size 
Php :: db raw update laravel 
Php :: php sort associative array by specific value 
Php :: laravel session 
Php :: vscode open php tag autocomplete 
Php :: $conn-query("SET NAMES utf8"); 
Php :: valet switch php version 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =