I had the same error while including file from root of my project in codeigniter
.I was using this in common.php
of my project.
<?php include_once base_url().'csrf-magic-master/csrf-magic.php'; ?>
i changed it to
<?php include_once ('csrf-magic-master/csrf-magic.php'); ?>
Working fine now.