Ииииии внимание ОТВЕТ!
sudo apt-get install libapache2-mod-php7.0
Так что если кому надо пользуйтесь.
Устанавливал все такими коммандами:
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
Как захожу в
localhost вижу Apache2 Ubuntu Default Page
It works! . Видать работает. Если ввести
systemctl status 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)
комманда sudo php -v
показывает
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
Создал в директории /var/www/html/ файл index.php если просто щелкнуть на него мышкой откроется браузер и предложет файл сохранить, если опять же ввести
localhost будет в браузере сообщение об ошибке - 503 Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80.
Собственно и вопрос как открывать файлы php? Хотелось бы освоить написание сайтов на PHP.
логи в /var/log/apache2
[Fri Apr 20 10:27:16.008033 2018] [mpm_prefork:notice] [pid 1906] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 10:27:16.008057 2018] [core:notice] [pid 1906] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 10:42:29.140511 2018] [mpm_prefork:notice] [pid 1906] AH00169: caught SIGTERM, shutting down
[Fri Apr 20 10:42:30.228951 2018] [mpm_prefork:notice] [pid 4491] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 10:42:30.229010 2018] [core:notice] [pid 4491] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 10:46:59.120437 2018] [mpm_prefork:notice] [pid 4491] AH00169: caught SIGTERM, shutting down
[Fri Apr 20 10:47:00.195116 2018] [so:warn] [pid 4692] AH01574: module php7_module is already loaded, skipping
[Fri Apr 20 10:47:00.250121 2018] [mpm_prefork:notice] [pid 4693] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 10:47:00.250146 2018] [core:notice] [pid 4693] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 11:26:47.132960 2018] [mpm_prefork:notice] [pid 4693] AH00169: caught SIGTERM, shutting down
[Fri Apr 20 13:15:54.807306 2018] [so:warn] [pid 2169] AH01574: module php7_module is already loaded, skipping
[Fri Apr 20 13:15:55.059374 2018] [mpm_prefork:notice] [pid 2170] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 13:15:55.059424 2018] [core:notice] [pid 2170] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 14:23:14.735637 2018] [mpm_prefork:notice] [pid 2170] AH00169: caught SIGTERM, shutting down
[Fri Apr 20 17:28:03.293100 2018] [so:warn] [pid 2283] AH01574: module php7_module is already loaded, skipping
[Fri Apr 20 17:28:04.807520 2018] [mpm_prefork:notice] [pid 2296] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 17:28:04.807576 2018] [core:notice] [pid 2296] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 20:53:21.062375 2018] [proxy:error] [pid 2328] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/run/php/php7.2-fpm.sock (*) failed
[Fri Apr 20 20:53:21.062433 2018] [proxy_fcgi:error] [pid 2328] [client 127.0.0.1:55524] AH01079: failed to make connection to backend: httpd-UDS
[Fri Apr 20 21:09:04.081546 2018] [mpm_prefork:notice] [pid 2296] AH00169: caught SIGTERM, shutting down
[Fri Apr 20 21:57:49.211905 2018] [so:warn] [pid 2101] AH01574: module php7_module is already loaded, skipping
[Fri Apr 20 21:57:50.340125 2018] [mpm_prefork:notice] [pid 2110] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 20 21:57:50.340172 2018] [core:notice] [pid 2110] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 20 22:06:04.940699 2018] [proxy:error] [pid 2141] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/run/php/php7.2-fpm.sock (*) failed
[Fri Apr 20 22:06:04.940775 2018] [proxy_fcgi:error] [pid 2141] [client 127.0.0.1:39546] AH01079: failed to make connection to backend: httpd-UDS