title: Why does PHP 7.4 with mysqli only run in root directory?
body: <p>Recently my hosting site (HostGator) upgraded my site's PHP from 5.4 to 7.4.  Pages that had php with mysqli statements in them failed, after working without incident in version 5.4.  Code like:</p>
  <pre><code>&lt;body&gt;
  &lt;?php include(&quot;menu_primary.html&quot;);?&gt;
  Some text
  &lt;?php 
      $servername = &quot;localhost&quot;;
      $username = &quot;my_username&quot;;
      $password = &quot;my_password&quot;;
      $database = &quot;my_database&quot;;
      
      // Create connection
      $link = mysqli_connect($servername, $username, $password, $database);
          // Check connection
          if (!$link) {
              die(&quot;Connection failed: &quot; . mysqli_connect_error());
          }   
  </code></pre>
  <p>would fail on the statement: <code>mysqli_connect($servername, $username, $password, $database);</code>  <br/>
  but the statement <code>&lt;?php include(&quot;menu_primary.html&quot;);?&gt;</code> would execute fine.
  After a lot of trial and error, I got the idea to move the entire PHP file from the folder <code>/public_html/my_app</code> to the folder <code>/public_html</code> .  Then everything worked fine again.  <br/>
  Those two files were edited as part of the upgrade from PHP 5.4 to PHP 7.4.  <br/>
  Question: Is there something I have to do in the <code>/public_htmnl/.htaccess</code> or the <code>/public_html/php.ini</code> files to allow embedded PHP to execute in a directory subordinate to <code>/public_html</code> ?
  Thanks for looking at this.</p>