Я использую Ubuntu14.04. Я установил ЛАМПУ, следуя https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04. Мой apache2 работает правильно, и я могу запустить мой HTML-код с локального хоста (файлы расположены в / var / www / html).
Но php-код не распознается сервером.
Я создал файл info.php с небольшим кодом:
<?php
phpinfo();
?>
но когда я запускаю этот файл на localhost, страница становится полностью пустой. Во время работы консоль показывает следующую проблему:
«Кодировка символов документа HTML не была объявлена. Документ будет отображаться с искаженным текстом в некоторых конфигурациях браузера, если документ содержит символы вне диапазона US-ASCII. Кодировка символов страницы должна быть объявлена в документе или в протокол передачи «
И мой файл error.log выглядит следующим образом:
[Mon Nov 16 20:37:45.283256 2016] [mpm_prefork:notice] [pid 20929] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Nov 14 20:37:45.283356 2016] [core:notice] [pid 20929] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 14 20:40:24.735968 2016] [mpm_prefork:notice] [pid 20929] AH00169: caught SIGTERM, shutting down
[Mon Nov 14 20:40:25.840171 2016] [mpm_prefork:notice] [pid 22341] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.20 configured -- resuming normal operations
[Mon Nov 14 20:40:25.840227 2016] [core:notice] [pid 22341] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 14 20:40:41.605555 2016] [mpm_prefork:notice] [pid 22341] AH00169: caught SIGTERM, shutting down
[Mon Nov 14 20:40:42.681091 2016] [mpm_prefork:notice] [pid 22602] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Nov 14 20:40:42.681183 2016] [core:notice] [pid 22602] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 14 20:41:40.780397 2016] [mpm_prefork:notice] [pid 22602] AH00169: caught SIGTERM, shutting down
[Mon Nov 14 20:41:41.858300 2016] [mpm_prefork:notice] [pid 25445] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Nov 14 20:41:41.858389 2016] [core:notice] [pid 25445] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 14 20:42:16.827964 2016] [mpm_prefork:notice] [pid 25445] AH00169: caught SIGTERM, shutting down
[Mon Nov 14 21:03:24.137314 2016] [mpm_prefork:notice] [pid 2734] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Mon Nov 14 21:03:24.147525 2016] [core:notice] [pid 2734] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 14 21:07:46.182694 2016] [mpm_prefork:notice] [pid 2734] AH00169: caught SIGTERM, shutting down
[Tue Nov 15 10:40:33.259452 2016] [mpm_prefork:notice] [pid 2751] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Tue Nov 15 10:40:33.272838 2016] [core:notice] [pid 2751] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 15 10:53:47.215292 2016] [mpm_prefork:notice] [pid 2751] AH00169: caught SIGTERM, shutting down
[Tue Nov 15 10:53:48.283869 2016] [mpm_prefork:notice] [pid 4413] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Tue Nov 15 10:53:48.283959 2016] [core:notice] [pid 4413] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 15 11:34:57.239683 2016] [mpm_prefork:notice] [pid 4413] AH00169: caught SIGTERM, shutting down
[Tue Nov 15 11:36:22.382513 2016] [mpm_prefork:notice] [pid 2780] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Tue Nov 15 11:36:22.393188 2016] [core:notice] [pid 2780] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 15 11:46:26.058513 2016] [mpm_prefork:notice] [pid 2780] AH00169: caught SIGTERM, shutting down
[Tue Nov 15 11:48:56.045051 2016] [mpm_prefork:notice] [pid 3367] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Tue Nov 15 11:48:56.077525 2016] [core:notice] [pid 3367] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 15 12:45:56.797705 2016] [mpm_prefork:notice] [pid 3367] AH00169: caught SIGTERM, shutting down
[Tue Nov 15 12:45:57.866547 2016] [mpm_prefork:notice] [pid 5056] AH00163: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Tue Nov 15 12:45:57.866640 2016] [core:notice] [pid 5056] AH00094: Command line: '/usr/sbin/apache2'
Пожалуйста, помогите исправить и решить проблему. Большое спасибо.
Задача ещё не решена.
Других решений пока нет …