php does not work

Discussion in 'Programming/Scripts' started by Tom John, Feb 12, 2020.

  1. Tom John

    Tom John Active Member HowtoForge Supporter

    Hi guys,
    i just made an update to ubuntu 19.10. i installed the lamp before on linux and with localhost/index.php i could see the website.
    Now when i go to localhost/index.php i can see the sourcecode of the website but not the website running.
    do you have any idea what can be the problem?
    Code:
    <?php
    include 'inc/header.php';
    
    ?>
    
    
    
    
    
           <div class="panel panel-default">
             <h2>User Registration</h2>
    
           </div>
           <div class="panel-body">
             <div style="max-width: 600px; margin:0 auto">
    
             <form action="" method="POST">
               <div class="form-group">
                 <label for="name"> Your Name </label>
                 <input type="text" id="name" name="name" class="form-control" />
    
               </div>
               <div class="form-group">
                 <label for="username"> User Name </label>
                 <input type="text" id="username" name="username" class="form-control" />
    
               </div>
               <div class="form-group">
                 <label for="email"> Email Address </label>
                 <input type="text" id="email" name="email" class="form-control" />
    
               </div>
               <div class="form-group">
                 <label for="password"> Password </label>
                 <input type="password" id="password" name="password" class="form-control" />
    
               </div>
             </form>
    
    <button type="submit" name="login" class="btn btn-success"> Submit </button>
    
           </div>
    </div>
    
           <?php
           include 'inc/footer.php';
    
           ?>
    
    thanks for your kind help
    Tom
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Have you installed the necessary PHP packages? The symptom you describe indeed looks like website does not execute the PHP script. Try running PHP from command line, does it work then?
     
  3. Tom John

    Tom John Active Member HowtoForge Supporter

    Hi
    thanks for your quick answer. I have the problem with the chrome browser only , with firefox it is working normally.

    when i run php from command line it works:
    Code:
    tom@tom-air:~$ php -r 'echo function_exists("foo") ? "yes" : "no";'
    notom@tom-air:~$ 
    
     
  4. Steini86

    Steini86 Active Member

    Try again in incognito mode. If it behaves differently with browsers, it looks like a caching problem.
     
  5. Tom John

    Tom John Active Member HowtoForge Supporter

    In incognito mode its the same problem, i can see only the source code
     
  6. Steini86

    Steini86 Active Member

Share This Page