dongyi9330 2019-03-21 14:42 采纳率: 100%
浏览 13

为什么同一个应用在不同的服务器上有不同的行为

I'm working on my first Laravel app, that at some stage loops through a large amount of data and I temporary added a primitive progress bar so I can have an idea how long it will take to finish...

It is working as it should on Win 8.1 XAMPP, but when I move it to Windows server 2016 (IIS + PHP 7.3.1 + MySQL 5.5) , the page just keeps loading, then suddenly it's 100%... or it the whole process fails, but that's an other problem.

Here is my primitive code:

  1. create the progress bar html

    echo'<div class="w3-container  w3-display-middle" style="width:75%">
    <p id="progress2text" style="visibility: hidden;">Pre-analyzing</p>
    <div class="w3-border" id="progress2" style="height:24px; visibility: hidden;"></div><br>
    <p>Analyzing - Do not close the page! You will be redirected when it is done...</p>
    <div class="w3-border" id="progress3" style="height:24px;"></div>
    

    ';

  2. making the progress bar visible

    echo '<script language="javascript">
                document.getElementById("progress2text").style.visibility = "visible";
                document.getElementById("progress2").style.visibility = "visible";   
        </script>';
    
  3. updating process bar at the beginning of every loop

    while(){
    //caluclating $percent here 
            echo '
            <script language="javascript">
                document.getElementById("progress2").innerHTML="<div class=\"w3-green w3-center\" style=\"height:24px;width:'.$percent.'%\">'.$percent.'%</div>";   
            </script>';
    }
    

Thank you.

  • 写回答

0条回答 默认 最新

    报告相同问题?