0

I have upgraded my php/xampp to 7.4.8 on my local machine and my laravel project initially threw an error. I updated the composer by running update composer command. After composer update, the project works fine and all the APIs are returning correct reponse

I have now hosted the same project on AWS ec2 and the php version is the same (7.4) and made the necessary settings like configuring the virtual host file and other necessary permissions.

However, I am getting an error. Its a long html error response but a snap of the error is below

<!DOCTYPE html>
<html>
    <head>
        <meta name="robots" content="noindex,nofollow" />
        <style>
            /* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */
            html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
            html { background: #eee; padding: 10px }
            img { border: 0; }
            #sf-resetcontent { width:970px; margin:0 auto; }
                        body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; margin: 0; padding-bottom: 45px; }

            a { cursor: pointer; text-decoration: none; }
            a:hover { text-decoration: underline; }
            abbr[title] { border-bottom: none; cursor: help; text-decoration: none; }

            code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; }

            table, tr, th, td { background: #FFF; border-collapse: collapse; vertical-align: top; }
            table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; }
            table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; }
            table th { background-color: #E0E0E0; font-weight: bold; text-align: left; }

            .hidden-xs-down { display: none; }
            .block { display: block; }
            .break-long-words { -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; }
            .text-muted { color: #999; }

            .container { max-width: 1024px; margin: 0 auto; padding: 0 15px; }
            .container::after { content: ""; display: table; clear: both; }

            .exception-summary { background: #B0413E; border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 30px; }

            .exception-message-wrapper { display: flex; align-items: center; min-height: 70px; }
            .exception-message { flex-grow: 1; padding: 30px 0; }
            .exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; }
            .exception-message.long { font-size: 18px; }
            .exception-message a { border-bottom: 1px solid rgba(255, 255, 255, 0.5); font-size: inherit; text-decoration: none; }
            .exception-message a:hover { border-bottom-color: #ffffff; }

            .exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; }

            .trace + .trace { margin-top: 30px; }
            .trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; }

            .trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }

            .trace-file-path, .trace-file-path a { color: #222; margin-top: 3px; font-size: 13px; }
            .trace-class { color: #B0413E; }
            .trace-type { padding: 0 2px; }
            .trace-method { color: #B0413E; font-weight: bold; }
            .trace-arguments { color: #777; font-weight: normal; padding-left: 2px; }

            @media (min-width: 575px) {
                .hidden-xs-down { display: initial; }
            }
        </style>
    </head>
    <body>
                    <div class="exception-summary">
                <div class="container">
                    <div class="exception-message-wrapper">
                        <h1 class="break-long-words exception-message">Trying to access array offset on value of type null</h1>
                        <div class="exception-illustration hidden-xs-down"><svg viewBox="0 0 136 81" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.4"><path d="M92.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0 1.5.2 2.1.1.5.3.7.6.6.5-.1 1-.9 1-.9a4 4 0 0 1-.3-1c-.3-1.3.3-3.6 1-3.7.2 0 .3.2.5.7v.8l.2 1.5v.7c.2.7.7 1.3 1.5 1 1.3-.2 2-2.6 2.1-3.9.3.2.6.2 1 .1-.6-2.2 0-6.1-.3-7.9-.1-.4-1-.5-1.7-.5h-.4zm-21.5 12c.4 0 .7.3 1 1.1.2 1.3-.3 2.6-.9 2.8-.2 0-.7 0-1-1.2v-.4c0-1.3.4-2 1-2.2zm-5.2 1c.3 0 .6.2.6.5.2.6-.3 1.3-1.2 2-.3-1.4.1-2.3.6-2.5zm18-.4c-.5.2-1-.4-1.2-1.2-.2-1 0-2.1.7-2.5v.5c.2.7.6 1.5 1.3 1.9 0 .7-.2 1.2-.7 1.3zm10-1.6c0 .5.4.7 1 .6.8-.2 1-1 .8-1.6 0-.5-.4-1-1-.8-.5.1-1 .9-.8 1.8zm-14.3-5.5c0-.4-.5-.7-1-.5-.8.2-1 1-.9 1.5.2.6.5 1 1 .8.5 0 1.1-1 1-1.8z" fill="#fff" fill-opacity=".6"/></svg></div>
                    </div>
                </div>
            </div>

            <div class="container">
                                    <div class="trace trace-as-html">
                        <table class="trace-details">
                            <thead class="trace-head"><tr><th>
                                <h3 class="trace-class">
                                    <span class="text-muted">(1/1)</span>
                                    <span class="exception_title"><abbr title="ErrorException">ErrorException</abbr></span>
                                </h3>
                                <p class="break-long-words trace-message">Trying to access array offset on value of type null</p>
                            </th></tr></thead>
                            <tbody><tr><td><span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/app/Exceptions/Handler.php line 98"><strong>Handler.php</strong> line 98</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Application">Application</abbr></span><span class="trace-type">-></span><span class="trace-method">Laravel\Lumen\Concerns\{closure}</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/app/Exceptions/Handler.php line 98"><strong>Handler.php</strong> line 98</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="App\Exceptions\Handler">Handler</abbr></span><span class="trace-type">-></span><span class="trace-method">render</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Routing/Pipeline.php line 78"><strong>Pipeline.php</strong> line 78</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Routing\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">handleException</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Routing/Pipeline.php line 54"><strong>Pipeline.php</strong> line 54</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Routing\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Laravel\Lumen\Routing\{closure}</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/app/Http/Middleware/ClientSecureMiddleware.php line 24"><strong>ClientSecureMiddleware.php</strong> line 24</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="App\Http\Middleware\ClientSecureMiddleware">ClientSecureMiddleware</abbr></span><span class="trace-type">-></span><span class="trace-method">handle</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/illuminate/pipeline/Pipeline.php line 163"><strong>Pipeline.php</strong> line 163</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Illuminate\Pipeline\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Illuminate\Pipeline\{closure}</span>(<span class="trace-arguments"></span>)</td></tr>
<tr><td>at <span class="trace-class"><abbr title=""></abbr></span><span class="trace-type"></span><span class="trace-method">call_user_func</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Routing/Pipeline.php line 32"><strong>Pipeline.php</strong> line 32</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Routing\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Laravel\Lumen\Routing\{closure}</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/app/Http/Middleware/ApiDataLogger.php line 27"><strong>ApiDataLogger.php</strong> line 27</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="App\Http\Middleware\ApiDataLogger">ApiDataLogger</abbr></span><span class="trace-type">-></span><span class="trace-method">handle</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/illuminate/pipeline/Pipeline.php line 163"><strong>Pipeline.php</strong> line 163</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Illuminate\Pipeline\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Illuminate\Pipeline\{closure}</span>(<span class="trace-arguments"></span>)</td></tr>
<tr><td>at <span class="trace-class"><abbr title=""></abbr></span><span class="trace-type"></span><span class="trace-method">call_user_func</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Routing/Pipeline.php line 32"><strong>Pipeline.php</strong> line 32</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Routing\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Laravel\Lumen\Routing\{closure}</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/illuminate/pipeline/Pipeline.php line 104"><strong>Pipeline.php</strong> line 104</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Illuminate\Pipeline\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">then</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 413"><strong>RoutesRequests.php</strong> line 413</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Application">Application</abbr></span><span class="trace-type">-></span><span class="trace-method">sendThroughPipeline</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 259"><strong>RoutesRequests.php</strong> line 259</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Application">Application</abbr></span><span class="trace-type">-></span><span class="trace-method">handleFoundRoute</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 165"><strong>RoutesRequests.php</strong> line 165</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Application">Application</abbr></span><span class="trace-type">-></span><span class="trace-method">Laravel\Lumen\Concerns\{closure}</span>(<span class="trace-arguments"></span>)</td></tr>
<tr><td>at <span class="trace-class"><abbr title=""></abbr></span><span class="trace-type"></span><span class="trace-method">call_user_func</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Routing/Pipeline.php line 52"><strong>Pipeline.php</strong> line 52</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Routing\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Laravel\Lumen\Routing\{closure}</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/app/Http/Middleware/ApiDataLogger.php line 27"><strong>ApiDataLogger.php</strong> line 27</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="App\Http\Middleware\ApiDataLogger">ApiDataLogger</abbr></span><span class="trace-type">-></span><span class="trace-method">handle</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/illuminate/pipeline/Pipeline.php line 163"><strong>Pipeline.php</strong> line 163</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Illuminate\Pipeline\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Illuminate\Pipeline\{closure}</span>(<span class="trace-arguments"></span>)</td></tr>
<tr><td>at <span class="trace-class"><abbr title=""></abbr></span><span class="trace-type"></span><span class="trace-method">call_user_func</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Routing/Pipeline.php line 32"><strong>Pipeline.php</strong> line 32</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Routing\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">Laravel\Lumen\Routing\{closure}</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/illuminate/pipeline/Pipeline.php line 104"><strong>Pipeline.php</strong> line 104</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Illuminate\Pipeline\Pipeline">Pipeline</abbr></span><span class="trace-type">-></span><span class="trace-method">then</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 413"><strong>RoutesRequests.php</strong> line 413</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Application">Application</abbr></span><span class="trace-type">-></span><span class="trace-method">sendThroughPipeline</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 171"><strong>RoutesRequests.php</strong> line 171</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Application">Application</abbr></span><span class="trace-type">-></span><span class="trace-method">dispatch</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php line 108"><strong>RoutesRequests.php</strong> line 108</span></span></td></tr>
<tr><td>at <span class="trace-class"><abbr title="Laravel\Lumen\Application">Application</abbr></span><span class="trace-type">-></span><span class="trace-method">run</span>(<span class="trace-arguments"></span>)<span class="block trace-file-path">in <span title="/var/www/od_serv/api_v4/index.php line 28"><strong>index.php</strong> line 28</span></span></td></tr>
</tbody>
</table>
</div>

            </div>
    </body>
</html>

I am out of ideas how to fix this. Can someone please give me some clues on how to get it fixed. I am not a php or AWS expert but have basic knowledge of using php and linux

Regards Syed

4
  • This will include a stack trace, what is the line the first item returns? Commented Aug 9, 2020 at 10:26
  • Thanks for your reply. I have edited my question and included the whole trace Commented Aug 9, 2020 at 10:32
  • What is on the line 28 of /var/www/od_serv/api_v4/index.php? Commented Aug 9, 2020 at 10:35
  • its the default laravel index.php. on line 28, the code is $app->run(); Commented Aug 9, 2020 at 10:38

1 Answer 1

1

Ultimately this is coming down to bad handling of attempting to access an array key on a property that the code treats as always existing even if it doesn't.

In this case the value is null, I will explain below using code.

$array = null;
$value = $array['key']['sub_key']; //In pseudocode this is the equivalent of running null['key']['sub_key']

As you can see the above would just not work at all as the value is null, this is the error you are receiving.

This is normally fixed by wrapping in an isset function i.e. isset($array['key']['sub_key']) before attempting to assign the value.

Form looking at the error stack I believe Laravel is not handling a missing array gracefully, in fact it seems like several issues have been raised for places in the framework since PHP 7.4 was released, so it is worth raising this.

As it is working in one environment but not another, all I can suggest is the following:

  • Ensure you're running the latest version of Laravel
  • Compare any PHP config between the environments.
Sign up to request clarification or add additional context in comments.

2 Comments

Many thanks for the detailed reply. If I update Laravel through composer update in my local machine and copy the whole project to AWS, do I still need to update laravel on the AWS EC2?
If you ran composer update and then copied the exact contents then yes, generally people would commit their composer.lock and then when they build their app run composer install with the update composer.lock but it depends how your setup is :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.