473,378 Members | 1,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

PHP and MS SQL Enterprise Problems

I am working with PHP and need it to connect to a MS SQL Enterprise database on a different server. I have read TONS of suggestions and nothing works, here is the situation:

-IIS is on a Win XP Pro System with PHP5 Installed (the rest of php seems to be running fine).
-extension=php_mssql.dll is uncommented- not only has the service been restarted but the computer has been rebooted several times
-We are NOT running Apache as well.
-SQL Server is version 8 running on a Win 2003 Server
-the ntwdblib.dll file from the SQL server is copied to the XP system in the system32, php AND php/ext directories
-SQL Server is set up for both named pipes and TCP/IP
-SQL Server will accept both NT authorization and SQL server logins

Here is my code:

$connection = @mssql_connect('SQLServer','usrnm','psswd');
echo 'Made it bast the attempt to connect';
if (!$connection)
{
echo 'Could not connect'; }
else { echo 'Connected';}'

The Web stops when it gets to the connect statement, it will not send any of the echo'd statements.

I have found code statements with and without the leading '@', without it, I get:

Fatal error: Call to undefined function mssql_connect() in C:\Inetpub\wwwroot\NewSite\news.php on line 47


Can someone please help, I am up against a wall and connot contiue with the website until I figure out the configuration problem.

Thanks
Jul 17 '07 #1
14 2006
mwasif
802 Expert 512MB
Fatal error: Call to undefined function mssql_connect() in C:\Inetpub\wwwroot\NewSite\news.php on line 47
It shows you have not installed MSSQL extension successfully. Check out this http://www.php.net/manual/en/ref.mssql.php.
Jul 17 '07 #2
I've read that, I can't find what I'm missing.

The ntwsdblib.dll is available on the IIS machine, the php_mssql.dll is uncommented in the php.ini and is located in the php/ext directory. The php/ext directory is where php is looking for it's dll's. What else is there to do? I've been fighting with this for over a week and I need to get this working.

Please someone help me, I'm so frustrated.
Jul 17 '07 #3
Motoma
3,237 Expert 2GB
Have you installed the SQL Server Client Tools?
Jul 17 '07 #4
Client Tools are installed.

I've installed the newest service pack for SQL Server as well.

It seems that the dll isn't loading and I can't figure out why. Everything is where it should be (as near as I can tell) and uncommented. I even made sure that there weren't 2 php.ini files and it was loading a different one than I edited; that wasn't it either.
Jul 17 '07 #5
Motoma
3,237 Expert 2GB
Client Tools are installed.

I've installed the newest service pack for SQL Server as well.

It seems that the dll isn't loading and I can't figure out why. Everything is where it should be (as near as I can tell) and uncommented. I even made sure that there weren't 2 php.ini files and it was loading a different one than I edited; that wasn't it either.
What installer did you use for Apache, PHP, and MySQL?
Jul 17 '07 #6
We do not have Apache.

We are using MS SQL Enterprise, not MySQL and it was installed using the original CD on the server.

The PHP was installed using the manual installation directions on php.net.

I don't mean to sound short, I have just lost my patience with this problem as it makes no sense.
Jul 17 '07 #7
Motoma
3,237 Expert 2GB
We do not have Apache.

We are using MS SQL Enterprise, not MySQL and it was installed using the original CD on the server.

The PHP was installed using the manual installation directions on php.net.

I don't mean to sound short, I have just lost my patience with this problem as it makes no sense.
My apologies for my miswording and assumptions, I understand that this is a MSSQL problem, I just can't type.

What version of PHP do you have installed. What version of IIS are you using?
I am going to assume that phpinfo does not show any MSSQL information. Correct me if that assumption is wrong.
Jul 17 '07 #8
I really do appreciate the help, this is driving me buggy. I can understand mistyping, there is a typo in one of the echo statements I was using to see where the code dies. I guess I'm just frustrated with all the help sites seem to concentrate on MySQL and some don't even acknowledge that there are any other databases out there.

I am using the IIS server that installs with Windows XP Pro. 5.1

I am using PHP5 (not sure how to get more detailed than that, it isn't as easy to locate as in a Window's app).

And you are correct. When I run phpinfo() it says nothing about mssql.

I guess this is what you get when you assign a setup/configuration issue to a programmer and dba.
Jul 17 '07 #9
Motoma
3,237 Expert 2GB
I really do appreciate the help, this is driving me buggy. I can understand mistyping, there is a typo in one of the echo statements I was using to see where the code dies. I guess I'm just frustrated with all the help sites seem to concentrate on MySQL and some don't even acknowledge that there are any other databases out there.

I am using the IIS server that installs with Windows XP Pro. 5.1

I am using PHP5 (not sure how to get more detailed than that, it isn't as easy to locate as in a Window's app).

And you are correct. When I run phpinfo() it says nothing about mssql.

I guess this is what you get when you assign a setup/configuration issue to a programmer and dba.
I understand entirely (after all, I am the mod for the SQL Server forum). I have had numerous problems setting up MSSQL to work with PHP on Windows, and I have never been able to narrow down a solution that works all of the time. If you have the time, you may want to pursue an alternative; the FreeTDS package should allow you to access MSSQL, and you can find instructions for it here.
Jul 17 '07 #10
I understood that package was for Linux/Unix. Not Windows.

I have seen several places where a file called config.php is refered to, I don't have that anywhere on my PC. They refer to it as well.

I've started looking into it and it looks to be as big a problem as php itself. That site was confusing as it seems to be the installation directions for a piece of software that uses FreeTDS.

So, I went to the FreeTDS site itself and isn't much better. It talks about using 'ntbox.mydomain.com' as the server name. The site I'm working on is for an intranet and the server and IIS are on different boxes. I only have the server name and IP the rest is web related isn't it?

I hate feeling this usless. It can't be this difficult.
Jul 17 '07 #11
I just tried seeing if I can get any of the other libraries to load, it doesn't seem to be a MSSQL problem. PHP isn't loading any of the extension=... that are uncommented.
Jul 17 '07 #12
Motoma
3,237 Expert 2GB
I just tried seeing if I can get any of the other libraries to load, it doesn't seem to be a MSSQL problem. PHP isn't loading any of the extension=... that are uncommented.
Is your extension directory correctly set?
Have you restarted IIS after making changes?
Are you modifing the correct php.ini?
Jul 17 '07 #13
I have restarted the service more times that I can count. I've even rebooted a few times (actually due to a different thing here on the network involving the roaming profiles and a few times out of frustration).

The extension directory is set to c:\php\ext and that is where the dll's are.

And I already thought of the php.ini problem, there is only one on the PC, it is in the c:\php folder and that directory is in the path for the system.
Jul 17 '07 #14
I got over the first hurdle!

It seems that I had done the IIS config wierd, I had done part cgi and part isapi. Once I switched it all to cgi it is loading the libraries!

Now I just have to figure out the login failures. At least here I'm a little more solid ground.

Thanks for you help, at least for letting me bounce things around in your direction.
Jul 17 '07 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: PF | last post by:
On one of our machines, all of the SQL Server 2000 components except for the main Server component (SQL Server core) itself were installed (Management tools, etc) a while ago and everything was...
1
by: bitunwise | last post by:
I had a problem today where I could not see column names and all tables had a _1 after them when viewing a Sql Server view in Enterprise Manager e.g. TableName Company when added to the view...
1
by: MarkMurphy | last post by:
We had downloaded the Enterprise Localization Framework a few months ago for evaluation and were using it under .NET Framework 1.0. We've just now upgraded to .NET Framework 1.1 and have started...
1
by: Eduard Ralph | last post by:
Hi, I've been having a very weird problem in connection with using the Enterprise Library. I'm programming a Windows Service and utilise the logging and configuration component. During the...
7
by: galico | last post by:
Hi All, We are having a very strange problem with the above. We have designed an application in ASP.NET 2.0 that uses the enterprise library data application blocks amongst others. We seem to be...
5
by: Jim Devenish | last post by:
I am having some problems in the process of moving an Access back-end to an SQL Server back-end. Everything works but there are severe problems of response times when the number of users builds...
4
by: uanmi | last post by:
Please create an Enterprise Library Forum asap. There is no help on gotdotnet for the many people asking questions. My project is stuck without some answers. -- regards, Mark
3
by: bungle | last post by:
Hi, I have started using MS Enterprise Library for the data access layer and found it great. I have changed to coding on another machine though and didn't think it necessary to a full install of...
23
by: Nishant Saini | last post by:
Dear All, We have a database which contains many tables which have millions of records. When We attach the database with MS SQL Server 2005 Standard Edition Server and run some queries (having...
62
by: estherschindler | last post by:
This is part of a series examining the strengths and weaknesses of various scripting languages, with particular attention to enterprise (read: big company) use. You Used Python to Write WHAT?...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.