I installed my drupal page on a hosting and i have a domain but this domain is hosted by an another company. Is there a small fix to connect the host and domain ?
Inside drupal settings.php by default is this, yes i already have the user sql everything but dont know how to connect the domain and hosting... maybe i need to add the Ip of the hosting ? but where? :
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'prefix' => 'main_',
'collation' => 'utf8_general_ci', );
Thank you for the help!
Connecting a domain and hosting has nothing to do with Drupal. That bit of script in the settings is only telling Drupal where the MySQL server is. localhost meaning that the MySQL server is on the same server as that file (the same server as Drupal).
You need to login to your domain registrar and enter the nameservers for your host.
The best and easiest way is to change your current DNS settings for your domain and point them to the server where your drupal website is hosted.
another possibility is to go to your domain registry and change the authoritative NS hosts for your domain to the ones provided by your host, so you can manage your DNS settings via your webhost and connect your domain to your server.
your webhost support should help you regarding this if you're still not sure how to do it.
Related
I'm getting this error when trying to connect to an SQL Server DB from Laravel 4.2.
Here's my DB config:
'connections' => array(
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'example.noip.me',
'database' => 'db',
'username' => 'sa',
'password' => 'pass',
'prefix' => '',
),
),
//...
It works perfectly in my home computer, but not in production. This project is in a hosting service, so I can't change much of the config (can still use ini_set though).
I tried adding the port to the server address but it didn't work.
Edit: I forgot to mention that the hosting and the database server are on different computers, so it could be a security configuration problem.
I contacted tech support and it turned out to be a matter of configuration in the hosting server (Remote Database Access Hosts, which I thought was for MySQL only).
I having one yii app hosted on godaddy windows hosting server,
All db config is ok but i am facing one error as **CDbException
CDbConnection failed to open the DB connection.**
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=my_db_name',
'emulatePrepare' => true,
'username' => 'myusername',
'password' => 'mypassword',
'charset' => 'utf8',
'tablePrefix' => 'tbl_'
),
all host name dbname username and pasword is correct then also i am facing with this error.
If someone have all ready solved this problem of hosting yii app on godaddy windows server please help me....
Thank you in advance..
Does the error message continue with "could not find driver?" Godaddy has PHP's PDO extension disabled on its Windows boxes (see here). Fastest solution were to change your hosting plan to Linux.
I've a laravel app nad I've been testing it with gmail smtp server and It was working in my system's localhost but then I deployed it on server (blue host) and change the configuration and still the app thinks that is sending emails and it's not giving me errors but no email is delivered to corresponding email addresses....
Here's my mail.php in app folder:
return array(
'driver' => 'smtp',
'host' => 'mail.mash-up.fi',
'port' => 26,
'from' => array('address' => 'registration#mash-up.fi', 'name' => 'Admin'),
'encryption' => 'tls',
'username' => '************',
'password' => '******',
'sendmail' => '/usr/bin/sendmail -bs',
'pretend' => false,
);
where I'm doing wrong?
any help is appreciated
If you are using the BH DNS(ns1.bluehost...), then check to see that the $from address is an existing email in your BH account.
(go to your CP /domain manager and use whois info to find that out.)
or.....
maybe, you migrated the source code, but did you transfer your domain name to BH, or is it pointing to BH servers (DNS)
In that case your site is not using the BH mail servers.
example :your site content could be on BH, but if it is registered somewhere else and the DNS is not ns1.bluehost.com..etc, then your domain might be using url forwarding or framing (to bring visitors to the BH location). but your mail functions may be handled by the registrar's
hope this is not too confusing
it is also helpfull if you post your domain name here and others can help figure out as well.
Please try to check the spam folder of where your sending to. If there is nothing, make sure your "from" is truly your bluehost email account your using to send the email. If the actual sender doesn't match the "from" of the e-mail many mail clients will ignore it entirely (like hotmail), but gmail will put it in the spam folder with a warning.
The host should be your bluehost box I think. In fact on cpanel, go to email, where you create accounts. Then click on "More", select "Configure Email Client", scroll down. You will see the host name, and port.
TTL/SSL would likely need port 465, I am guessing (I use the latter, not the former like you).
Open up the laravel.logs file inside of storage > logs. It should help give you some idea of what the problem might be.
I want to connect to an external Database on another Host (not localhost) on Drupal because i want to migrate Content with the Migrate Module.
thats in my settings.php
$databases['for_migration']['default'] = array(
'driver' => 'mysql',
'database' => 'dbname',
'username' => 'username',
'password' => 'password',
'host' => 'other-host.com',
'prefix' => '',
'port' => '',
);
And in another method im calling the database via:
$query = Database::getConnection('default', 'for_migration')
thats the error which appears:
PDOException: SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'host.com' (13) in MigrateMigration->__construct() (Zeile 16 von /var/www/html/x/sites/all/modules/migrate_x/x.inc).
So if i call a database on localhost, there are no errors and all migrates perfectly. But i cant connect to a database on an external host.
That could be due to:
1) connection limitation (firewall block, for example).
2) the account you are using does not allows logins outside of "localhost". In this case, you will have to edit your account hostname mask on the 'user' table inside the 'mysql' database for '%' (which means, any address) or the machine IP address you are accessing from.
It was my fault. I have set httpd_can_network_connect on the remote server to on.
But the solution was to set it on my local machine. After that i can connect to an external Host. So it was a SELinux Problem.
Thanks to #fobia
I understand this problem has been a recurring problem on this site, but my issue is a little different than the previous ones.
PROBLEM
Some pages use the correct socket directory, while other pages try and connect through an incorrect socket directory or this is what I believe the problem is based on the error i am receiving.
DETAILS
HOST: example.com
cakePHP version: 1.3.2 (Not my choice).
Page's content comes from database.
URL: http://example.com
My website has 2 sections:
anonymous section
login section for members or admin
The anonymous section works. It accesses the database, adds the content, and funcitons as it should.
ERROR
The error occurs when I click a link "view more.." under "Job Links" on the home page. A login form should pop up, instead i receive the error "cannot connect to local MySql server through socket '/var/run/mysqld/mysqld.sock' (2)".
In addition, after I login via the "Members login" button, also on the home page, with the correct credentials, it also produces the same error.
QUESTION
Why would different sections on my webpage try to access the sockets through different directories?
ADDITIONAL STUFF
I signed up today and this is my first post, so feedback on my post regarding enough information would be helpful for future posts.
Thanks for your time.
UPDATE
Upon further research, MySql has been using the socket directory /var/run/mysqld/mysqld.sock from the start. Not sure what this means yet, but continuing research..
database.php file
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysqli',
'persistent' => true,
'host' => 'redlabelcom.netfirmsmysql.com',
'login' => 'bcp',
'password' => '********',
'database' => 'bcp',
'prefix' => '',
'encoding' => 'UTF8',
//'socket' => '/var/run/mysqld/mysqld.sock', // I've tried commenting out all variations of socket and port
//'port' => '/var/run/mysqld/mysqld.sock', // nothing works.
);
var $test = array(
'driver' => 'mysqli',
'persistent' => false,
'host' => 'redlabelcom.netfirmsmysql.com',
'login' => 'bcp',
'password' => '********',
'database' => 'bcp',
'prefix' => '',
'encoding' => 'UTF8',
//'port' => '/var/run/mysqld/mysqld.sock',
);
}
?>
This problem is really strange. I guess this has something to do with mysql connection. MySQL is a daemon, usually configured in /etc/mysql/my.cnf. There you define how the client will connect the MySQL server:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
If your socket is wrong (there's no such socket on the server), you are probably connecting different mysql host/port from anonymous/secured parts of application. This is possible (I mean different db connections from different application parts). Check your configuration (host, port, etc.) and try to connect from MySQL console:
$ mysql -h hostname -u username -p dbname # enter password
and check if you can connect. If you can connect from console, you'll surely connect from any server-side application (php, python, whatever).
It's an application that someone else was developing, right, and now you have to maintain it?
PROBLEM SOLVED!
Thanks everyone for your support!
This was an interesting issue that initially looked more complicated than the actual problem.
cakephp version 1.3.2 is set up to make a new connection to the database if you need to access the phpbb data fields. The new connection uses a different configuration than what is set up in the database.php file.
Below is a detailed description with file locations.
the 'app/webroot/discussion/common.php' file makes a NEW connection to the database using a different set of MySql parameters than the database.php file. Again, it does NOT use database.php's MySql configuration.
Instead, cakephp defines new connection variables located at:
'app/webroot/discussion/config.php'
To solve the problem, simply change the
$dbhost => localhost -> $dbhost => yourservername
$dbname => wrongname -> $dbname => rightname
etc..
Keep in mind that it is possible the previous developer changed these values, so if this doesn't help you then good luck.
BTW, the error message above was the result of trying to connect to localhost.
To resolve this issue, I ran the following commands:
mysqld --tc-heuristic-recover=ROLLBACK
systemctl start mariadb.service