Call to undefined function mssql_connect() error in new PHP install

I am trying to set up PHP on a Windows 2003 Server box to communicate with a SQL Server 2005 install on the same box.  I have taken the following steps in installing PHP

2)      Extract PHP zip file to C:\PHP
3)      Copy php.ini_recommended to PHP.ini
4)      In PHP.ini take the ; off the beginning of the line extension=php_mssql.dll
5)      Put C:\PHP in path environment variable
6)      Under Properties for the web site in IIS, go to Home Directory tab and
              a.      chance Execute permissions to Scripts Only
              b.      Click Configuration Button
                            i.      On the mappings tab, click Add .  Executable is C:\php\php.exe and the extension is .php
7)      Copy ntwdblib.dll and php_mssql.dll to C:\PHP and C:\Windows\System32
8)      Reboot server fully

Now when I try to connect to the server I get the above error.  I have added this script:


if (function_exists('mssql_connect')) {
      echo "Okay, fn is there";
} else {
      echo "Hmmm .. fn is not even there";
}

and I get the "fn is not even there" message.

Can someone help, please???
thearniecAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hernst42Commented:
You need to copy the created php.ini to your c:\windows directory or the directory given in your phpinfo()-Output for "Configuration File (php.ini) Path" Then restart the webserver and try again
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
syedasimmeesaqCommented:
>>>7)      Copy ntwdblib.dll and php_mssql.dll to C:\PHP and C:\Windows\System32
make sure php_mssql.dll is in extension directory and you have the right path set to the extensions directory in php.ini

Also make sure that you set environment variable for the systems...and reboot your box.

Thanks
0
Frosty555Commented:
Cross posted to another question (http://www.experts-exchange.com/Database/MySQL/Q_23135294.html), but I'll state the same thing here:

Don't put anything in your system32 folder. It isn't the correct way to setup php and can cause problems later. Instead, put your ntwdblib.dll file in your c:\php folder, and put php_mssql.dll in the C:\php\ext folder.

Make sure you have done the following:

1) You should put the C:\Program Files\PHP folder in the system path. To add the folder to your path:

Right click on my computer->properties
advanced tab
click "environment variables"
under system variables ( the bottom box ) select "path". click "edit"
This is a semicolon delimited list of paths. Add C:\Program Files\PHP to it. The last item should have a semicolon on the end.
Reboot the computer for changes to take effect.

PHP_MSSQL.dll is an extension. It should be in C:\PHP\Ext, and configured in the php.ini file.

In your php.ini, you should have your extension loaded in the "Dynamic Extensions" section:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
extension=php_mssql.dll

And also, your EXTENSION_DIR should be set to the extension directory in your php folder. e.g.:

extension_dir ="C:\PHP\ext"


--------


Finally, make sure you are editing the CORRECT php.ini. Call phpinfo(); from any php page to output a whole pile of information about php. In there it should state which ini file is being used. OFTEN PHP USES C:\WINDOWS\PHP.INI, and not the php.ini in the c:\php.ini folder.

Also remember, before any changes take effect, you need to restart the php and IIS services. Better would be for you to restart your entire computer. It doesn't just take effect automatically. So before you test, restart the computer.
0
thearniecAuthor Commented:
Thank you for your help, it worked instantly!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.