PHP joins SQL Server 2008 not even up!

Source: Internet
Author: User
PHP Connection SQL Server 2008 not even up!
The operating system is win server R2, the database is SQL Server 2008,php Version 5.4.14,
Look in the phpinfo of the output
-------------------------------------------------
PDO supportenabled
PDO Driversmysql, SQLite, sqlsrv

However, if you want to access the database using Sqlsrv, the "HTTP error 500.0" Prompt always appears,
-------------------------------------------------
Module Fastcgimodule
Notify Executerequesthandler
Handler php54_via_fastcgi
Error code 0x00000000


This is a routine that accesses the opcode that is actually copied from Microsoft Driver for PHP for SQL Server:

/* Specify the server and connection string attributes. */
$serverName = "(local)";
$connectionInfo = Array ("Database" = "myDB1");

/* Connect using Windows authentication. */
$conn = Sqlsrv_connect ($serverName, $connectionInfo);
if ($conn = = = False)
{
echo "Unable to connect.
";
Die (Print_r (Sqlsrv_errors (), true));
}
Else

";
?>

Share to:


------Solution--------------------
Configure PHP.ini to open PHP's expansion to MSSQL.
------Solution--------------------
PDO Driversmysql, SQLite, Sqlsrv???
Only this one?
You write a single program
 
  Var_dump (function_exists (' sqlsrv_connect '));
See what the output is.



------Solution--------------------
I use the PHP version is 5.2.6 has been in normal use.
------Solution--------------------
No kidding!
A single sentence
Var_dump (function_exists (' sqlsrv_connect '));
This could be an HTTP error 500.0-internal Server error
is at most bool (false)
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.