mardi 4 juin 2019

Host your web locally to test it from a LAN connection and check HTTP communication with another hardware

I have created a website. it is running perfectly in my local machine, localhost (say PC-1). I used apache and MariaDB. For testing purpose I want to check it from other PCs (say PC-2) in the same LAN network (using Wifi). I have seen many explanation to get it done. seems like nothing worked for me so far. Do I need to set a static IP for my PC-1 ? Do I need to change my Apache configuration file?Is there any problem if any kind of messaging apps like skype running in the background(any port using conflicts?) What changes I should make for database connection? I want to test a hardware's HTTP communication. so it is important for me!


//what changes I need here
  <?php
      $dbhost ="localhost"; 
      $dbuser="root"; // mysql username
      $dbpass="****"; // mysql password
      $db="TestDatabase"; // database you want to use
      $conn= mysqli_connect( $dbhost, $dbuser, $dbpass, $db ) 
or die("Could not connect: " .mysqli_error($conn) );
   ?>





Aucun commentaire:

Enregistrer un commentaire