first of all my problem is the following.
I am trying to connect to a database in my local network using a php script.
my php script includes the following lines
<?php
echo "1";
$conn = new mysqli("192.168.xxx.xxx", "user", "password", "testdb");
echo "2";
?>
I am only getting output the first echo statment. The second one is missing. It seems to me as if the script stops and can not continue for reasons unknown to me.
My Setup is: -Two lubuntu VM's in Virtualbox connected via the Host-Only option
-First VM - Apache2, php7.3, mysql-server & mysql-client, phpmyadmin.
-Second VM - Apache2, php7.3, mysql-client.
Everything is up-to-date and on the exact same version.
basically Im trying to establish a connection from VM2 to VM1 via php to use that on a website (running on VM2) and manipulate db entries from this website.
Things I have found out and done until now:
-If I am using this script on the machine with the db installed and use "localhost" it displays both echo while viewing the website which means to me that it is successfully connected.
-the db user im using is definitely allowed to connect from remote and is not bound to localhost.
-the both VMs are reachable for eachother and I can establish a mysql connection from VM2 to VM1 through CLI.
What am I missing?