Hola, debes escapar el $ de access, sino, te pinta el valor que trae dicha variable.
Código PHP:
<?php
$permindex = <<<EOT
<?
session_start();
\$access = 1;
include("includes/conexion.php");
include("includes/funciones.php");
?>
EOT;
$fp = fopen("index.php", "w");
fwrite($fp, $permindex);
fclose($fp);
?>
Saludos.