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 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.
In the list of phpinfo() do you see MSSQL server enabled?
Archie
No..only ODBC
I noticed that all the configuration that I do in my php.ini did not take efffect or appear in my phpinfo() and also the Configuration File(php.ini) Path in my phpinfo() is C:\WINDOWS, but my php.ini is in C:\php also the extensin_dir that appear in my phpinfo is C:\php5 but I configure my extension_dir in my php.ini as C:\php\ext
No..only ODBC
I noticed that all the configuration that I do in my php.ini did not take efffect or appear in my phpinfo() and also the Configuration File(php.ini) Path in my phpinfo() is C:\WINDOWS, but my php.ini is in C:\php also the extensin_dir that appear in my phpinfo is C:\php5 but I configure my extension_dir in my php.ini as C:\php\ext
Feels like you should re-install PHP so that you get the correct configurations (never worked with PHP on Windows so I don't know how to add stuff after the install).
Feels like you should re-install PHP so that you get the correct configurations (never worked with PHP on Windows so I don't know how to add stuff after the install).
Archie
I solved the problem by moving php.ini from C:\php to C:\WINDOWS
I solved the problem by moving php.ini from C:\php to C:\WINDOWS
I've read this tonight and it's 2 years after you wrote, and its working after few hours of googling.
Trying all steps from all webs but didn't works, And finally your few simple words change my life!!
Bookmarks