PHP - Occasional Unknown Server Host; Mysqli_connect() [function.mysqli-connect]: (hy000/2005)
Most of the time my localhost works like a champ but occasionally I get ... mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'localhost' (11001)
On phpfreaks I've searched for "Unknown MySQL server host localhost " and didn't see an answer to this problem Then I googled and found this http://stackoverflow...-localhost11001 However in this file the localhost ip is commented out and windows wont let me edit the file to uncomment it like it's done in the stackflow post. So, one is this the likely problem ... and if it is how do I edit a file in the Windows folder? As a note I do go into the file as the administrator using notepad Thanks Edited by floridaflatlander, 03 June 2014 - 08:21 AM. Similar TutorialsGood Day
I have a bit of an issue with my website I loaded on my domain.
I am getting an error:
SQLSTATE[HY000] [1130] Host 'xxx.xxx.xx.xxx' is not allowed to connect to this MySQL server
Can some one please explain to me in detail how do fix this?
It only shows on my Sale and Rent pages
Hi friends... I am using Wamp with PHP 5.3 and want to connect with SQL Server 2005 but not successful. I also tried it with PHP 5.2.8 but it still not working. I google it and found some solutions but not successsful yet. Can anyone give me detailed guide (step by step) that how i can connect PHP with Sql Server 2005??? Thanks in advance... This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=319948.0 This topic has been moved to Installation in Windows. http://www.phpfreaks.com/forums/index.php?topic=312024.0 After I did enable the following error reporting: Code: [Select] Default Value: E_ALL & ~E_NOTICE I am getting the error message described in the title of this thread. I do have the php_mysqli.dll extension enabled as well - AND the function used to work as is, before I changed the error reporting, thus the function actually should be defined, what could be another reason, that PHP thinks it is not a defined function? Hi all I was trying to connect to a database which is running on an external host. So i thought i try the stuff below. That didn't work. Is it possible that the host has disabled external connection or something? I tried to add http:// before the domain, but no succes either Code: [Select] <?php $dbc = mysqli_connect('db87654321.somedomain.com','user','pass','database')// this is line 5 or die(mysqli_error($dbc)); echo 'connected'; ?> it gave the following error: Quote Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'db87654321.somedomain.com' (11004) in H:\xampp\htdocs\databasetestfile.php on line 5 P.s. the script worked when upload to the server. P.p.s is there something i should be carefull with when connection to an external database? hi all First of all My client have dot net server on windows OS. They want to display some pages which are created by php. Is there any possibility to display like this. And How can i connect sql server using php on remote to retrieve data. Can any one tell me how can i do this. Thanks in advance Hi I am trying to send email through following php code to may gmail account but it givrs me SMTP Error: Could not connect to SMTP host.
*******************************************************************************************************************************************************
<?phpif(isset($_POST['submit'])){ $message='Full Name: '.$_POST['fullname'].'<br />Subject: '.$_POST['subject'].'<br />Phone: '.$_POST['phone'].'<br />Email: '.$_POST['emailid'].'<br />Comments: '.$_POST['comments'].''; require "phpmailer/class.phpmailer.php"; //include phpmailer class // Instantiate Class $mail = new PHPMailer(); // Set up SMTP $mail->IsSMTP(); // Sets up a SMTP connection $mail->SMTPAuth = true; // Connection with the SMTP does require authorization $mail->SMTPSecure = "ssl"; // Connect using a TLS connection $mail->Host = "smtp.gmail.com"; //Gmail SMTP server address $mail->Port = 465; //Gmail SMTP port $mail->Encoding = '7bit'; // Authentication $mail->Username = "myemail@gmail.com"; // Your full Gmail address $mail->Password = "mypassword"; // Your Gmail password // Compose $mail->SetFrom($_POST['emailid'], $_POST['fullname']); $mail->AddReplyTo($_POST['emailid'], $_POST['fullname']); $mail->Subject = "New Contact Form Enquiry"; // Subject (which isn't required) $mail->MsgHTML($message); // Send To $mail->AddAddress("myemail@gmail.com", "Recipient Name"); // Where to send it - Recipient $result = $mail->Send(); // Send! $message = $result ? 'Successfully Sent!' : 'Sending Failed!'; unset($mail); }?><html><head> <title>Contact Form</title></head><body> <div style="margin: 100px auto 0;width: 300px;"> <h3>Contact Form</h3> <form name="form1" id="form1" action="" method="post"> <fieldset> <input type="text" name="fullname" placeholder="Full Name" /> <br /> <input type="text" name="subject" placeholder="Subject" /> <br /> <input type="text" name="phone" placeholder="Phone" /> <br /> <input type="text" name="emailid" placeholder="Email" /> <br /> <textarea rows="4" cols="20" name="comments" placeholder="Comments"></textarea> <br /> <input type="submit" name="submit" value="Send" /> </fieldset> </form> <p><?php if(!empty($message)) echo $message; ?></p> </div> </body></html> Hi guys
I'll try keep this simple
I have been given access to a betting xml feed which requires my IP to be whitelisted.
I have whitelisted my home IP and it works fine.
I have whitelisted an IP on server 1 (linux, cpanel), this works fine
I have whitelisted an IP on server 2 (linux, cpanel), this doesn't work and I get:
"simplexml_load_file failed to open stream: http request failed!"
The IP is definitely whitelisted but I think it is something to do with the server. What could be blocking this?
allow_url_fopen and allow_url_include are both on by the way
Many thanks
Sam
I've been working on this for 8 hours and still cannot get sqlsrv_connect to work. Thank you, Microsoft. My connection strings work for Access DBs and MySQL - but I can't get this to work. For servername, I've tried: $serverName = "MYSERVER"; $serverName = "(MYSERVER\MYINSTANCE)"; $serverName = "'MYSERVER\MYINSTANCE'"; $serverName = "(MYSERVER)"; Setup: PHP Compiler = MSVC9 (Visual C++ 2008) C:\Program Files (x86)\PHP\v5.3\php.ini extension_dir C:\Program Files (x86)\PHP\v5.3\ext\ php_sqlsrv_53_nts_vc9.dll in the extension library. And I'm getting an error from sqlsrv_errors, so it looks like the DLL is working. Pulling my hair out here. Any ideas? Code: [Select] $serverName = "MYSERVER\MYINSTANCE"; $connectionInfo = array("UID" => $uid, "PWD" => $pwd, "Database"=>"$dbname"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if($conn) { echo "Connection established.\n"; } else { echo "Connection could not be established.\n"; die( print_r( sqlsrv_errors(), true)); } sqlsrv_close( $conn); Connection could not be established. Array ( => Array ( => 08001 => 08001 [1] => 53 => 53 [2] => [SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. => [SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. ) [1] => Array ( => HYT00 => HYT00 [1] => 0 => 0 [2] => [SQL Server Native Client 10.0]Login timeout expired => [SQL Server Native Client 10.0]Login timeout expired ) [2] => Array ( => 08001 => 08001 [1] => 53 => 53 [2] => [SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. => [SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) ) I have a script that is trying to connect from one server to another and it doesn't seem to let it. Could someone help me please Code: [Select] Can't connect to MySQL server on 'example.com' (4) I am using this: $tags = @get_meta_tags($http["domain"]); Is there any way to tell if that function can not connect to the server for reasons such as server being down, or an invalid URL? Is there a way for me to connect to a directory on a NAS server running a windows share from PHP. I can connect from the command line using mount, but I want the connect within my PHP script. Can this be done & if so how? Hi, When i am trying to run one script on my web server, i get following error Cannot connect to the database using the info you provided Access denied for user 'My_Username'@'localhost' (using password: NO) I filled all info like Host(localhost) Database name(created in cpanel) Username(created in cpanel) Password(i kept blank dont know where to find this) You help will highly appreciate Thanks, Ravindra My code is: <?php echo system("openssl s_client -crlf -connect pop3.live.com:995"); ?> This connects fine. However, I don't know how to log in now. If I'm connecting from the terminal I then type "user annie" followed by "pass idontlikesand". I don't know how to pipe this in using php. Any ideas? hello sir, i have to connect database to my live server using <?php
define('DB_HOST', 'localhost'); ?> or
Have actually tried this mailer on localhost and it worked perfectly. Now am trying to use it on online but it's giving this error
SMTP-> ERROR: Failed to connect to server: Connection timed out (110)
SMTP -> ERROR: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP Host.
please how do i fix this?
include "classes/class.phpmailer.php"; // include the class name $mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail $mail->Host = "smtp.gmail.com"; $mail->Port = 465; // or 587 $mail->IsHTML(true); $mail->Username = "hypropsict@gmail.com"; $mail->Password = "hyprops123"; $mail->SetFrom("hypropsict@gmail.com"); $mail->Subject = "Requisition Processed"; $mail->Body = "<b>Hello $firstname, your requisition has been processed and Approved.. <br/><br/>Come to the Account department to recieve your $text . <br/> Thank You </b>"; $mail->AddAddress($email); if(!$mail->Send()){ echo "Mailer Error: " . $mail->ErrorInfo; } The information on the php.net documentation seems to be out of date.
http://php.net/manua...databases.mssql
as the link to the necessary libraries for Linux is broken.
Can you tell me, or point me to what is needed to connect to MSSQL with PHP 5.3.3/Apache on Red Hat Linux
If there is more than one option, we would like to know what they are and the installation details.
Thanks
Okay guys I have finished my db and I want to upload it to a live server but don't know exactly what to change in the code to get the ODBC_connect to open the path at the new server location please help. my database is located in a subfolder called Databases i.e. "www.mydomain.com/Databases/myEvents.mdb" what do i change in the connection string below to get it to open the file on the live server? Thanks in advance. $conn = odbc_connect('myEvents','',''); |