Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MohammadAbusaleh's avatar

Blade won't work on server.

Good Day,

Website is working fine on homestead, my cheap client wants to use GoDaddy Shared hosting plan. So I uploaded the wesbite there and done the necessary steps to make it work on shared hosting (I've done it a few times before).

Now the problem is blade isn't working, I keep getting this error when I visit any page: FatalErrorException in f9c03dabd451edf48bd7b313226d0962 line 54: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ']'

I made sure /storage/framework/views has 777 permission, still didn't work.

I removed everything from the index page, and wrote some text without using blade and it is working fine.

Thanks all for helping

0 likes
13 replies
mstnorris's avatar

Side note: What version of PHP is the server running? My first instinct is that Laravel requires PHP > 5.5.9 and shared hosting on GoDaddy will be less than that (I haven't checked). See https://laravel.com/docs/5.2/#server-requirements for more details.

Anyway, can you show some code of the file thats producing the error?

zachleigh's avatar

Show us one of the views that is failing. Youre getting a php error, so Blade is probably being run.

d3xt3r's avatar

Show the compiled view f9c03dabd451edf48bd7b313226d0962

MohammadAbusaleh's avatar

@zachleigh @d3xt3r

All views are not working, I changed the index page to this:

        @extends('frontend.master')

        @section('content')
            <h1>Test</h1>
        @endsection

and the compiled view:

<div id="header" class="sticky header-sm dark clearfix">
    <header id="topNav">
        <div class="container">
            <button class="btn btn-mobile" data-toggle="collapse" data-target=".nav-main-collapse">
                <i class="fa fa-bars"></i>
            </button>
            <a class="logo pull-left" href="<?php echo e(route('home')); ?>">
                <img src="/assets/images/logo/logo.png" height="50" width="180" alt="Horizon International Recruitment Services" />
            </a>
            <div class="navbar-collapse pull-right nav-main-collapse collapse submenu-dark">
                <nav class="nav-main">
                    <ul id="topMain" class="nav nav-pills nav-main">
                        <li>
                            <a href="<?php echo e(route('home')); ?>">
                                HOME
                            </a>
                        </li>
                        <li>
                            <a href="<?php echo e(route('frontend.jobs.all')); ?>">
                                JOBS
                            </a>
                        </li>
                        <li>
                            <a href="<?php echo e(route('contact')); ?>">
                                CONTACT
                            </a>
                        </li>
                        <li>
                            <a href="<?php echo e(route('about')); ?>">
                                ABOUT
                            </a>
                        </li>
                        <?php if(Auth::check()): ?>
                            <li class="dropdown">
                                <a class="dropdown-toggle" href="#">
                                    <?php echo e(Auth::user()->name); ?>

                                </a>
                                <ul class="dropdown-menu">
                                    <?php if (Auth::check() && Auth::user()->level() >= 2): ?>
                                    <li class="dropdown">
                                        <a href="<?php echo e(route('dashboard.home')); ?>">
                                            MY DASHBOARD
                                        </a>
                                    </li>
                                    <?php else: ?>
                                        <?php /*<li class="dropdown">*/ ?>
                                            <?php /*<a href="">*/ ?>
                                                <?php /*MY PROFILE*/ ?>
                                            <?php /*</a>*/ ?>
                                        <?php /*</li>*/ ?>
                                        <?php if(Auth::user()->resume): ?>
                                            <li>
                                                <a href="<?php echo e(route('mycv.show', ['id' => (Auth::user()->resume)->id, 'title' => str_slug((Auth::user()->resume)->title, '-')])); ?>">
                                                    MY CV
                                                </a>
                                            </li>
                                        <?php elseif(!Auth::user()->resume): ?>
                                        <li>
                                            <a href="<?php echo e(route('mycv.create')); ?>">
                                                CREATE MY CV
                                            </a>
                                        </li>
                                        <?php endif; ?>
                                        <?php endif; ?>
                                        <li class="dropdown">
                                            <a href="<?php echo e(route('logout')); ?>">
                                                LOGOUT
                                            </a>
                                        </li>
                                </ul>
                            </li>
                        <?php endif; ?>
                        <?php if ( ! (Auth::check())): ?>
                            <li>
                                <a href="<?php echo e(route('getLogin')); ?>">LOGIN/REGISTER</a>
                            </li>
                        <?php endif; ?>
                    </ul>
                </nav>
            </div>
        </div>
    </header>
</div>
MohammadAbusaleh's avatar

@mstnorris Yes the default is 5.5, but that can be changed to 5.6 which should work fine, also, all the views are not working, I posted one right above this comment. Thank you.

mstnorris's avatar

Update

Maybe not, the compiled view is a little hard to read this late in the evening. Let's take a look at the raw blade file.

First thought

It looks like you're missing a closing @endif after the "LOGOUT" block.

<li class="dropdown">
    <a href="<?php echo e(route('logout')); ?>">
        LOGOUT
    </a>
</li>

Can we see the raw blade file, not the compiled view.

d3xt3r's avatar
d3xt3r
Best Answer
Level 29

incorrect syntax at

 <a href="<?php echo e(route('mycv.show', ['id' => (Auth::user()->resume)->id, 'title' => str_slug((Auth::user()->resume)->title, '-')])); ?>">
                                        MY CV
                                    </a>

Check or show the original view where its defined, or correct it to

['id' => Auth::user()->resume->id, 'title' => str_slug(Auth::user()->resume->title, '-')]
MohammadAbusaleh's avatar

@mstnorris @d3xt3r Thank you both for helping, once I fixed the error @d3xt3r said it started working, but how come it was working fine on homestead and only got the error on the server? Any ideas would be great.

1 like
d3xt3r's avatar

Are you sure ? Hmm, that's a mystery for some other time :) as I too will have to check

MohammadAbusaleh's avatar

@d3xt3r I wouldn't upload the code if it wasn't working, right ? :'D I think i'll have to review my code again now. Thanks again.

Cheers

d3xt3r's avatar

but how come it was working fine on homestead and only got the error on the serve

It guess, it has to do with PHP version, checked on both on DO and homestead, running on PHP 7 +, no error, checked on localhost running PHP 5.6, same error as you :)

MohammadAbusaleh's avatar

@d3xt3r I kind of thought that this could be the problem when I woke up this morning, unfortunately I was very busy to test it, so thank you very much for helping and trying as well.

Please or to participate in this conversation.