Jump to content

mssql and php sry...8(


Recommended Posts

Ok so i'm not so sure this question belongs here but i'm having a hell of a time with it...

 

I'm trying to setup a new webserver using MS SQL(Which i hate!!!)

IIS 5, and PHP5.. now i have php installed and IIS 5 working and MS SQL working. My problem is that php5 won't use the mssql functions.. when i run this function in my browser it tells me the functions are not available:

 

 

Code:
<?php

if (function_exists('mssql_fetch_row')) {
echo "MSSQL functions are available.<br />\n";
} else {
echo "MSSQL functions are not available.<br />\n";
}

?>

I've uncommented the php_mssql.dll file in the ini and I have the client tools installed on the same pc..

 

the evironment variables are set correctly..

 

does ANYONE know of ANYTHING else that could be causing this?

 

Believe me if i could i would load up MYSQL in a heartbeat but i'm being forced to use MSSQL for work related reasons.

 

thanks in advance everyone...

 

ps. I've searched EVERYWHERE for a solution to this and cannot find one.

Link to comment
Share on other sites

Have you restarted IIS? Is PHP using the php.ini you are modifying (check this via phpinfo)

 

I believe the php_mssql.dll extension requires the msql.dll and ntwdblib.dll libraries in order to function. These files should be in the root of your PHP installation folder. If you have added your PHP foldert to the PATH then the problem is to do with something else.

 

Have you setup the extension_dir directive to point to your PHP extension folder. Make sure you use an absolute path (C:/path/to/php/ext) rather than a relative path (./../path/to/php/ext)

Link to comment
Share on other sites

Currently PHP is not reading a php.ini file after reviewing your phpinfo output you posted above.

 

Where is your php.ini file located to? It should be in C:\Inetpub\php (I assume this is where PHP is installed). If you haven't got a php.ini then rename the file called php.ini-recommended to php.ini

 

Restart IIS and rerun phpinfo() again. To see if PHP is reading your php.ini, the Loaded Configuration File line should be set to C:\Inetpub\php\php.ini

 

Ignore the Configuration File (php.ini) Path line.

 

Once you have gotten PHP to read the php.ini then read through the post PFMaBiSmAd linked to.

 

 

Link to comment
Share on other sites

just after my post i had taken a stronger look at my phpinfo page and realized that it said it was looking for my php.ini file in the c:\windows dir... so I moved both my ntwdbl.dll and my ini file to that directory... restarted and now it works...

 

tsks tsk tsk ... my bad... preciate the help everyone... i'm still left with a boggle however, and that is how do i alter that so that it looks in my php folder for the files rather then the windows dir?

Link to comment
Share on other sites

just after my post i had taken a stronger look at my phpinfo page and realized that it said it was looking for my php.ini file in the c:\windows dir... so I moved both my ntwdbl.dll and my ini file to that directory... restarted and now it works...

 

tsks tsk tsk ... my bad... preciate the help everyone... i'm still left with a boggle however, and that is how do i alter that so that it looks in my php folder for the files rather then the windows dir?

Move whatever files you moved back to your PHP folder. PHP does not require files to moved to the Windows folder. You should add PHP to the PATH Environment Variable. By adding PHP to the PATH, PHP will look for files in the PHP installation folder.

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.