Jump to content

mssql not loaded


newphpcoder

Recommended Posts

Good day!

 

I try a lot of configuration to work my connection from php to mssql but still I cannot connect. And I got a code to check if the mssql was loaded.

 

Here is the code:

<?php
if (function_exists('mssql_connect')){
echo "Okay, fn is there<br>------------------<br>";
} else {
echo "Hmmm .. fn is not even there<br>------------------<br>";
}

if(extension_loaded("mssql")) {
echo "MSSQL is Loaded<br>";
}
else {
echo "MSSQL not loaded<br>";
} 

if(extension_loaded("msql")) {
echo "MSQL is Loaded<br>";
}
else {
echo "MSQL not loaded<br>";
} 
echo '<br><br>';

$ext = get_loaded_extensions();
if(in_array('mssql', $ext))
echo 'u have mssql installed<br><br>';
else
echo 'u do NOT have mssql installed<br><br>';

phpinfo();
?>

 

And when I run this code the result is:

 

Hmmm….fn is not even there

----------------------

MSSQL not loaded

MSQL not loaded

You do NOT have mssql installed

And the list of phpinfo() appear.

 

Actually I run this code when my php version is php 5.2.4 and now I try it to php 5.1.4 and the result is still the same.

 

Web server is IIS 6.0

OS is Windows Server 2003 R2 Standard Edition

PHP version is php 5.1.4

MS SQL Server 2005 Express Edition –Windows Authentication.

 

I need to solved this problem because my connection in mssql is not working because call to undefined the function mssql_connect().

 

I hope somebody can help me. Almost three weeks I configure this connection and still I cannot connect.

 

Any help is highly appreciated.

Thank you.

 

 

 

 

Link to comment
Share on other sites

Check two things:

 

1. Is the php_mssql.dll file in your extension directory?

2. Is the php_mssql.dll extension enabled in your php.ini file?

 

If the answer to both of those questions is "yes", then you might be missing a dependency (like the ntwdblib.dll file).

 

BTW, since you are running PHP on Windows, I suggest you use the php_sqlsrv.dll extension. I've written about the difference between the mssql and the sqlsrv extensions here: http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx.

 

Hope that helps.

 

-Brian

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.