Answer the question
In order to leave comments, you need to log in
Apache2 and PHP 7 installed. How to run php files?
Iiiiiii attention ANSWER!
sudo apt-get install libapache2-mod-php7.0
So if anyone needs it, use it.
Installed everything with these commands:
sudo apt update
sudo apt install -y php7.2
sudo apt install php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mcrypt
sudo apt install apache2 libapache2-mod-php7.2
sudo apt install mysql-server php7.2-mysql
sudo apt install phpmyadmin
sudo systemctl restart apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Пт 2018-04-20 17:28:05 MSK; 3h 11min
Docs: man:systemd-sysv-generator(8)
Process: 1975 ExecStart=/etc/init.d/apache2 start (code=exited, statu
CGroup: /system.slice/apache2.service
├─2296 /usr/sbin/apache2 -k start
├─2327 /usr/sbin/apache2 -k start
├─2328 /usr/sbin/apache2 -k start
├─2329 /usr/sbin/apache2 -k start
├─2330 /usr/sbin/apache2 -k start
└─2331 /usr/sbin/apache2 -k start
апр 20 17:27:59 morilon systemd[1]: Starting LSB: Apache2 web server...
апр 20 17:27:59 morilon apache2[1975]: * Starting Apache httpd web ser
апр 20 17:28:03 morilon apache2[1975]: [Fri Apr 20 17:28:03.216910 2018
апр 20 17:28:03 morilon apache2[1975]: AH00558: apache2: Could not reli
апр 20 17:28:05 morilon apache2[1975]: *
апр 20 17:28:05 morilon systemd[1]: Started LSB: Apache2 web server.
lines 1-21/21 (END)
PHP 7.2.4-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Apr 5 2018 08:53:57) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.4-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
Answer the question
In order to leave comments, you need to log in
Replace the contents of the file index.php
with this.
There shouldn't be any mistakes.
check permissions on files and folders
Read detailed logs in /var/log/apache2
Set up Apache.
You have index.html registered there, but index.php is not mentioned, and when deleting index.html, you get an error.
Well, you need to enable the processing of php files.
php.net/manual/ru/install.unix.apache2.php
or https://httpd.apache.org/docs/2.4/
Apache and Pehape, this is not Microsoft Word for you, you need to configure them, look here , but even this example is very far from ideal
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question