-1
Guys, I’m having trouble getting other machines to connect to my localhost
, and the error always occurs:
Warning: mysqli_connect(): (HY000/2002): No connection to be made because the hand of destiny refused them actively. in C: Public Desktop Users phpdesktop-Chrome-57.0-rc-php-7. 1.3 www connected.php on line 7
This error happens only to other machines, for me the connection works normally!
PHP file of connection:
<?php
define('HOST', '127.0.0.1'); /*Se adicionado um ":1" no host, o erro ocorre para mim também*/
define('USUARIO', 'root');
define('SENHA', '[estou utilizando senha]');
define('DB', 'login');
$conexao = mysqli_connect(HOST, USUARIO, SENHA, DB) or die ('Não foi possivel conectar!');
mysqli_select_db($conexao, 'login') or die (mysql_error());
?>
It is important to remember that all the code is being converted to a Windows EXE file through PHP Desktop, since even using since program the connection usually occurs only for me and the error persists for other machines that try to open my program.
My firewall is disabled, although there are exceptions for ports 3306 and 80.
I am using XAMPP and with it the modules Apache and Mysql are activated normally.
(It is important that I continue to use PHP Desktop, as I have no knowledge of other ways to build an executable file for win.)
(I don’t have much knowledge with mysql)
My goal is to discover the source of the error and be able to grant access to my localhost for remote machines.
Thank you and sorry for some unnecessary information.
You need to specify the IP of the local network, open the Command Prompt in the machine in which the XAMPP and type ipconfig and see the line: IP Address / Ipv4 Address.
– NoobSaibot