PHP not accessing database on server but accessing database on localhost - cpanel

I've been trying to rectify this for days but it's leading me no where
It works well on localhost, but no accessing database on the remote server
I've spent a lot of hours on this
Here is the code:
$mysqli = mysqli_connect ('scholars.lextoXXX.com', 'scholars_root', '', 'scholars_crud') OR
trigger_error("Could not connect to the database!\n<br />MySQL Error: " .
mysqli_connect_error());
Is there a configuration for that on the server.
Thank you.

Have you enable remote mysql on your mysql server? Please try to enable it and allow port 3306 in server firewall so that you can access mysql.

Related

Postgres server is running locally but refusing connection

After installing postgres and pgAdmin 4 on Ubuntu 22.04 I want to setup a server listening on localhost.
The pg service is running
but when trying to create a new server I get the following error
I think the terminal error points to the same problem
I think the server is running locally but what am I missing / how can I accept the missing socket connections?
Could you check if the listen_addresses in the postgresql.conf accepts connections from localhost or set it to '*', if no special restriction required

Connection timeout while trying to SSH

Hope I'm doing this right as this is my first StackOverflow question. I'm trying to SSH into a server, but running the ssh command results in a connection timeout (using the MobaXTerm client on Win10). I'm trying to connect on port 22, and have gone through Windows Firewall to make rules to open the port, but it's still not working. Any ideas as to why this is happening? I can provide relevant information as needed.
Thanks in advance!
That error message means the server to which you are connecting does not reply to ssh connection on port 22. I think three possible reasons for that:
The server has not installed ssh
You are running ssh with different port
The machine has a firewall that doesnot allow you to connect

Connect host ldap server to local VM

I have a server installed on VM and a LDAP(opendj) server created using Apache Directory Studio on my host computer. Now, I would like to connect that LDAP server to local VM so that the VM server can pull user's information from LDAP server. is it possible to do that? I could not understand how to establish a communication between these two server.
Thanks.
Remote Port Forwarding actually does work here.
my ldap server port was 10389.
I have created a tunnel from host to vm:
ssh -R 10389:localhost:10389 root#172.16.130.132(vm-ip)
after then, vm can reach to the host through this port (10389).
Sorry, I don't have that much knowledge on ssh. But this one worked for me.

CANT START SQL IN XAMPP

I am facing some problem while starting sql in xampp. here is the screenshotenter image description here
Your SQL is attempting to use port 3306, which is already in use as stated in the error. Go into
Config > Service and Port Settings > Change 3306 to any other unused ports
Restart the service and see if it works.

How can i access the vps server

Have a VPS and access to WHM as cpanel.But how can i access the php.ini and also connect using SSH.With SSH getting error
Failed to connect to server:
Network error: Connection refused.
If there is a proxy that is blocking it?
This question is probably better asked at serverfault. Having said that, by default in common Linux distributions (Ubuntu, for example), SSHD is not running by default.
Verify that you are running an SSH server, and if you are still having issues, this is better taken somewhere more relevant.