php - How to integrate the sql server in cakephp


Here is my connection string.

public $default = array(
    'datasource' => 'Database/Sqlserver',
    'persistent' => false,
    'host' => 'SAI-PC\\SQLEXPRESS',
    'login' => 'sa',
    'password' => '123',
    'database' => 'SFAC_Connectmp',
    'prefix' => '',
    //'encoding' => 'utf8',
  • I am able to login the sql server using the above credentials and it works fine
  • I have checked all the options from the sql server manager. eg. -Sql server and browser services are running fine. -Remote server connection is checked -windows firewall is off -Still i get the error A Database connection using "Sqlserver" was missing or unable to connect.
    The database server returned this error: SQLSTATE[08001]: [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2].



Could it be the host name?

Try adding the port to the host with hostname:port

Is the server local? Does it work with localhost? Is it on the local network? Does it work with it's LAN ip?

Have you installed/enabled the php sqlsrv driver?

Try this

People are also looking for solutions to the problem: php - Generate an image to users wall by using facebook profile informations like profilepic,brthday etc


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.