D
D
dflbrhekbn2017-08-23 14:25:30
PHP
dflbrhekbn, 2017-08-23 14:25:30

Why is PHP code opening in the browser?

Ubuntu 16.04
Apache2
PHP7.0
Created an index.html file in /var/www/test.local folder and stuffed it with the following:
<?php
$site = "localhost";
$user = "root"; // login
$pass = "123"; // password
$name = "test"; // database name
......
?>
Created test.local.conf in /etc/apache2/sites-enabled and registered all paths and passwords I write test.local
in the browser and get the contents of my document. Where to run and what to do? If .html is changed to .php then just a "white screen"

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
marginBottom, 2017-08-23
@dflbrhekbn

mv index.html index.php

Q
Q001, 2017-08-23
@Q001

If you have PHP installed and when you rename index.html to index.php you get a white screen, then some error has been fixed in PHP.
You need to look at the PHP log.

Z
zooks, 2017-08-23
@zooks

Where to run and what to do?

Reread the first lesson or what you are doing there.

O
one_day, 2017-08-23
@one_day

index. html => index. php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question