Search code examples
phplaravelconsolevagrantlaravel-artisan

Laravel 4 - PHP tag is prefixed in artisan console and rendered pages


I have this weird issue with my project. When I'm using artisan command e.g.:

php artisan -v
<?phpLaravel Framework version 4.2.22

Also when I inspect page there is

<?php<!DOCTYPE html>
<html lang="en">
<head>

I can't figure out from where are <?php tags from, I checked whole project. I am using vagrant for local development, other projects with L4 works just fine.

This bothers me a lot, I can't even call ajax to get proper response without these tags. Thanks for any ideas.


Solution

  • I found it in app/start/local.php

    Someone changed

    <?php
    
    //
    

    to

    <?php
    

    and this caused the issues.

    Additional info: Removing file or just adding new line will fix the problem (or just leave it as it was before)