PHP to MS SQL Package

PHP to MS SQL Package

am 12.06.2008 18:14:03 von ajwei

Hi,

I am currently using a Linux box with Fedora 9.0 and I am trying to conne=
ct PHP to a MS SQL database. All the permissions on the MS SQL database is =
up to date and accurate, but I consistently get errors that say

PHP Fatal error: Call to undefined function mssql_connect() in /usr/local/=
apache/htdocs/create_new_entry_master.php on line 20

I have looked into the options of using FreeBSD, as suggested on the http:/=
/us3.php.net/manual/en/function.mssql-connect.php#83196, but I am not sure=
if I could use it since I don't use a Windows Machine to run my PHP.
Does anyone have any suggestions?

Alice
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP to MS SQL Package

am 12.06.2008 18:57:33 von olavi

Hi,

you need to install "freetds" before compiling php.

compile php:

../configure [--with-apxs --with-mysql...]
--with-sybase=/usr/local/freetds
make
make install

Olavi Ivask

On Thu, 2008-06-12 at 12:14 -0400, Wei, Alice J. wrote:
> Hi,
>
> I am currently using a Linux box with Fedora 9.0 and I am trying to connect PHP to a MS SQL database. All the permissions on the MS SQL database is up to date and accurate, but I consistently get errors that say
>
> PHP Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
>
> I have looked into the options of using FreeBSD, as suggested on the http://us3.php.net/manual/en/function.mssql-connect.php#8319 6, but I am not sure if I could use it since I don't use a Windows Machine to run my PHP.
> Does anyone have any suggestions?
>
> Alice
> ======================================================
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: PHP to MS SQL Package

am 12.06.2008 19:01:46 von ajwei

From: Olavi ivask [olavi@city.ee]
Sent: Thursday, June 12, 2008 12:57 PM
To: Wei, Alice J.
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] PHP to MS SQL Package

Hi,

you need to install "freetds" before compiling php.

compile php:

../configure [--with-apxs --with-mysql...]

You actually meant mssql, right? I am getting mine to connect to mssql, and=
not mysql.

--with-sybase=3D/usr/local/freetds
make
make install

Olavi Ivask

On Thu, 2008-06-12 at 12:14 -0400, Wei, Alice J. wrote:
> Hi,
>
> I am currently using a Linux box with Fedora 9.0 and I am trying to con=
nect PHP to a MS SQL database. All the permissions on the MS SQL database i=
s up to date and accurate, but I consistently get errors that say
>
> PHP Fatal error: Call to undefined function mssql_connect() in /usr/loca=
l/apache/htdocs/create_new_entry_master.php on line 20
>
> I have looked into the options of using FreeBSD, as suggested on the http=
://us3.php.net/manual/en/function.mssql-connect.php#83196, but I am not su=
re if I could use it since I don't use a Windows Machine to run my PHP.
> Does anyone have any suggestions?
>
> Alice
> ==================== =====
==================== =====3D=
=====3D
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: PHP to MS SQL Package

am 12.06.2008 19:43:30 von ajwei

Hi,

After stopping the Apache server, I reinstalled PHP by adding the line yo=
u had below, and then restarted Apache.

../configure
--with-apxs2=3D/usr/local/apache/bin/apxs \
--with-sybase=3D/usr/local/freetds
--prefix=3D/usr/local/apache/php \
make
make install

After this has been completed, I am still getting the same error about ho=
w the function is not defined.

Fatal error: Call to undefined function mssql_connect() in /usr/local/apac=
he/htdocs/create_new_entry_master.php on line 20

Could there be other options? Or, am I missing something here?

Alice
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu
________________________________________
From: Olavi ivask [olavi@city.ee]
Sent: Thursday, June 12, 2008 12:57 PM
To: Wei, Alice J.
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] PHP to MS SQL Package

Hi,

you need to install "freetds" before compiling php.

compile php:

../configure [--with-apxs --with-mysql...]
--with-sybase=3D/usr/local/freetds
make
make install

Olavi Ivask

On Thu, 2008-06-12 at 12:14 -0400, Wei, Alice J. wrote:
> Hi,
>
> I am currently using a Linux box with Fedora 9.0 and I am trying to con=
nect PHP to a MS SQL database. All the permissions on the MS SQL database i=
s up to date and accurate, but I consistently get errors that say
>
> PHP Fatal error: Call to undefined function mssql_connect() in /usr/loca=
l/apache/htdocs/create_new_entry_master.php on line 20
>
> I have looked into the options of using FreeBSD, as suggested on the http=
://us3.php.net/manual/en/function.mssql-connect.php#83196, but I am not su=
re if I could use it since I don't use a Windows Machine to run my PHP.
> Does anyone have any suggestions?
>
> Alice
> ==================== =====
==================== =====3D=
=====3D
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP to MS SQL Package

am 12.06.2008 19:44:23 von Ken Keefe

Alice, make sure the php-mssql package is installed.

# yum install php-mssql

You shouldn't have to compile php or freetds as there are packages
available to do what you want...

Ken

On Thu, Jun 12, 2008 at 11:14 AM, Wei, Alice J. wrote:
> Hi,
>
> I am currently using a Linux box with Fedora 9.0 and I am trying to connect PHP to a MS SQL database. All the permissions on the MS SQL database is up to date and accurate, but I consistently get errors that say
>
> PHP Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
>
> I have looked into the options of using FreeBSD, as suggested on the http://us3.php.net/manual/en/function.mssql-connect.php#8319 6, but I am not sure if I could use it since I don't use a Windows Machine to run my PHP.
> Does anyone have any suggestions?
>
> Alice
> ======================================================
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--

Naturally, the common people don't want war, but they can always be
brought to the bidding of the leaders. Tell them they are being
attacked, and denounce the pacifists for lack of patriotism and
endangering the country. It works the same in every country.

--- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: PHP to MS SQL Package

am 12.06.2008 19:58:36 von ajwei

________________________________________
From: Ken Keefe [kjkeefe@gmail.com]
Sent: Thursday, June 12, 2008 1:44 PM
To: Wei, Alice J.
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] PHP to MS SQL Package

Alice, make sure the php-mssql package is installed.

# yum install php-mssql

You shouldn't have to compile php or freetds as there are packages
available to do what you want...


I have just installed this gadget as you have listed, and then I have . The=
problem is that this does not get rid of what I had in my errors previousl=
y.

PHP Fatal error: Call to undefined function mssql_connect() in /usr/local=
/apache/htdocs/create_new_entry_master.php on line 20

Code snippet:
// connection to the database
$dbhandle=3D mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");

Ken

On Thu, Jun 12, 2008 at 11:14 AM, Wei, Alice J. wrote:
> Hi,
>
> I am currently using a Linux box with Fedora 9.0 and I am trying to conn=
ect PHP to a MS SQL database. All the permissions on the MS SQL database is=
up to date and accurate, but I consistently get errors that say
>
> PHP Fatal error: Call to undefined function mssql_connect() in /usr/loca=
l/apache/htdocs/create_new_entry_master.php on line 20
>
> I have looked into the options of using FreeBSD, as suggested on the http=
://us3.php.net/manual/en/function.mssql-connect.php#83196, but I am not su=
re if I could use it since I don't use a Windows Machine to run my PHP.
> Does anyone have any suggestions?
>
> Alice
> ==================== =====
==================== =====3D=
=====3D
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--

Naturally, the common people don't want war, but they can always be
brought to the bidding of the leaders. Tell them they are being
attacked, and denounce the pacifists for lack of patriotism and
endangering the country. It works the same in every country.

--- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: PHP to MS SQL Package

am 12.06.2008 20:20:05 von olavi

Hello,

Here is a good article about ms-sql & PHP on Linux
(http://www.devarticles.com/index2.php?option=content&task=v iew&id=667&pop=1&page=0&hide_js=1)


Olavi Ivask
On Thu, 2008-06-12 at 13:43 -0400, Wei, Alice J. wrote:
> Hi,
>
> After stopping the Apache server, I reinstalled PHP by adding the line you had below, and then restarted Apache.
>
> ./configure
> --with-apxs2=/usr/local/apache/bin/apxs \
> --with-sybase=/usr/local/freetds
> --prefix=/usr/local/apache/php \
> make
> make install
>
> After this has been completed, I am still getting the same error about how the function is not defined.
>
> Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
>
> Could there be other options? Or, am I missing something here?
>
> Alice
> ======================================================
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
> ________________________________________
> From: Olavi ivask [olavi@city.ee]
> Sent: Thursday, June 12, 2008 12:57 PM
> To: Wei, Alice J.
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] PHP to MS SQL Package
>
> Hi,
>
> you need to install "freetds" before compiling php.
>
> compile php:
>
> ./configure [--with-apxs --with-mysql...]
> --with-sybase=/usr/local/freetds
> make
> make install
>
> Olavi Ivask
>
> On Thu, 2008-06-12 at 12:14 -0400, Wei, Alice J. wrote:
> > Hi,
> >
> > I am currently using a Linux box with Fedora 9.0 and I am trying to connect PHP to a MS SQL database. All the permissions on the MS SQL database is up to date and accurate, but I consistently get errors that say
> >
> > PHP Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
> >
> > I have looked into the options of using FreeBSD, as suggested on the http://us3.php.net/manual/en/function.mssql-connect.php#8319 6, but I am not sure if I could use it since I don't use a Windows Machine to run my PHP.
> > Does anyone have any suggestions?
> >
> > Alice
> > ======================================================
> > Alice Wei
> > MIS 2009
> > School of Library and Information Science
> > Indiana University Bloomington
> > ajwei@indiana.edu
> >
>
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP to MS SQL Package

am 12.06.2008 20:21:10 von Ken Keefe

Make sure some where in your php.ini you have a line that looks like
this and is not commented out:

extension=mssql.so

I haven't used a fedora box as a php webserver in over a year, so my
memory of their config file layout is pretty rusty. However, I'm
pretty sure they consolidate everything into a single .ini file. I
always add a phpinfo.php file to my project so I can run it and see
which .ini file apache is using to configure php. All you have to put
in the phpinfo.php file is this line:



If you visit that page and look around, it will tell you where the
php.ini file is. Also, once you have mssql enabled, there will be a
section in the phpinfo.php page with all the mssql options. So,
looking at the phpinfo.php file is another good way to tell if you
have mssql installed properly.

Good luck!

Ken

On Thu, Jun 12, 2008 at 12:58 PM, Wei, Alice J. wrote:
> ________________________________________
> From: Ken Keefe [kjkeefe@gmail.com]
> Sent: Thursday, June 12, 2008 1:44 PM
> To: Wei, Alice J.
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] PHP to MS SQL Package
>
> Alice, make sure the php-mssql package is installed.
>
> # yum install php-mssql
>
> You shouldn't have to compile php or freetds as there are packages
> available to do what you want...
>
>
> I have just installed this gadget as you have listed, and then I have . The problem is that this does not get rid of what I had in my errors previously.
>
> PHP Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
>
> Code snippet:
> // connection to the database
> $dbhandle= mssql_connect($myServer, $myUser, $myPass)
> or die("Couldn't connect to SQL Server on $myServer");
>
> Ken
>
> On Thu, Jun 12, 2008 at 11:14 AM, Wei, Alice J. wrote:
>> Hi,
>>
>> I am currently using a Linux box with Fedora 9.0 and I am trying to connect PHP to a MS SQL database. All the permissions on the MS SQL database is up to date and accurate, but I consistently get errors that say
>>
>> PHP Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
>>
>> I have looked into the options of using FreeBSD, as suggested on the http://us3.php.net/manual/en/function.mssql-connect.php#8319 6, but I am not sure if I could use it since I don't use a Windows Machine to run my PHP.
>> Does anyone have any suggestions?
>>
>> Alice
>> ======================================================
>> Alice Wei
>> MIS 2009
>> School of Library and Information Science
>> Indiana University Bloomington
>> ajwei@indiana.edu
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
> --
>
> Naturally, the common people don't want war, but they can always be
> brought to the bidding of the leaders. Tell them they are being
> attacked, and denounce the pacifists for lack of patriotism and
> endangering the country. It works the same in every country.
>
> --- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials
>



--

Naturally, the common people don't want war, but they can always be
brought to the bidding of the leaders. Tell them they are being
attacked, and denounce the pacifists for lack of patriotism and
endangering the country. It works the same in every country.

--- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: PHP to MS SQL Package

am 12.06.2008 22:53:02 von ajwei

Hi,

I hope this would allow me to address this problem to a step further now.
After getting FreeTDS installed, my error has now moved away from the und=
efined function level.
I have looked through the PHP help from http://us3.php.net/manual/en/func=
tion.mssql-connect.php, and configured according to what has been listed in=
the user commentsThis is my error now:

PHP Warning: mssql_connect(): Unable to connect to server: 192.168.10.=
128 in /usr/local/apache/htdocs/test.php on line 22

As some of you suggested, I find it surprising that after installing Fre=
eTDS and referencing it when I was installing it using --with-sybase=3D/usr=
/local/freetds option when I installed the PHP, it kept on bringing me back=
errors saying that it cannot find it. I am not sure if it is the cause of =
why I still cannot connect. As for my php.info, I tried to run the search t=
o find mssql values, but I cannot find any.

Is this the reason why I still cannot connect to a different machine to =
its MS SQL using PHP? Have I missed something in my setup or something?
Note: The setup for the database is accessible by another computer using=
the same server passwords, etc.

I welcome any suggestions on t his.

Alice
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu
________________________________________
From: Olavi ivask [olavi@city.ee]
Sent: Thursday, June 12, 2008 2:20 PM
To: Wei, Alice J.
Cc: php-db@lists.php.net
Subject: RE: [PHP-DB] PHP to MS SQL Package

Hello,

Here is a good article about ms-sql & PHP on Linux
(http://www.devarticles.com/index2.php?option=3Dcontent&task =3Dview&id=3D66=
7&pop=3D1&page=3D0&hide_js=3D1)


Olavi Ivask
On Thu, 2008-06-12 at 13:43 -0400, Wei, Alice J. wrote:
> Hi,
>
> After stopping the Apache server, I reinstalled PHP by adding the line =
you had below, and then restarted Apache.
>
> ./configure
> --with-apxs2=3D/usr/local/apache/bin/apxs \
> --with-sybase=3D/usr/local/freetds
> --prefix=3D/usr/local/apache/php \
> make
> make install
>
> After this has been completed, I am still getting the same error about =
how the function is not defined.
>
> Fatal error: Call to undefined function mssql_connect() in /usr/local/ap=
ache/htdocs/create_new_entry_master.php on line 20
>
> Could there be other options? Or, am I missing something here?
>
> Alice
> ==================== =====
==================== =====3D=
=====3D
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
> ________________________________________
> From: Olavi ivask [olavi@city.ee]
> Sent: Thursday, June 12, 2008 12:57 PM
> To: Wei, Alice J.
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] PHP to MS SQL Package
>
> Hi,
>
> you need to install "freetds" before compiling php.
>
> compile php:
>
> ./configure [--with-apxs --with-mysql...]
> --with-sybase=3D/usr/local/freetds
> make
> make install
>
> Olavi Ivask
>
> On Thu, 2008-06-12 at 12:14 -0400, Wei, Alice J. wrote:
> > Hi,
> >
> > I am currently using a Linux box with Fedora 9.0 and I am trying to c=
onnect PHP to a MS SQL database. All the permissions on the MS SQL database=
is up to date and accurate, but I consistently get errors that say
> >
> > PHP Fatal error: Call to undefined function mssql_connect() in /usr/lo=
cal/apache/htdocs/create_new_entry_master.php on line 20
> >
> > I have looked into the options of using FreeBSD, as suggested on the ht=
tp://us3.php.net/manual/en/function.mssql-connect.php#83196, but I am not =
sure if I could use it since I don't use a Windows Machine to run my PHP.
> > Does anyone have any suggestions?
> >
> > Alice
> > ==================== ===3D=
==================== =====3D=
======
> > Alice Wei
> > MIS 2009
> > School of Library and Information Science
> > Indiana University Bloomington
> > ajwei@indiana.edu
> >
>
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP to MS SQL Package

am 13.06.2008 00:04:35 von Ken Keefe

That error message tells you that you are getting closer. Next step
would be to make sure you have a connection to that system:

$ ping 192.168.10.128

Next thing I would do is see if that port is open on the server:

$ telnet 192.168.10.128 1433

If it says something about "Escape character is ..." then the SQL
server is listening and no firewalls or anything are getting in the
way.

Finally, you probably need to add an entry at the bottom of your
/etc/freetds/freetds.conf file that looks like this:

[SomeNameForTheServer]
host = 192.168.10.128
port = 1433
tds version = 8.0

Then, in your php code, use the name you give (SomeNameForTheServer)
as the host instead of the IP address.

Good luck.

Ken

On Thu, Jun 12, 2008 at 3:53 PM, Wei, Alice J. wrote:
> Hi,
>
> I hope this would allow me to address this problem to a step further now.
> After getting FreeTDS installed, my error has now moved away from the undefined function level.
> I have looked through the PHP help from http://us3.php.net/manual/en/function.mssql-connect.php, and configured according to what has been listed in the user commentsThis is my error now:
>
> PHP Warning: mssql_connect(): Unable to connect to server: 192.168.10.128 in /usr/local/apache/htdocs/test.php on line 22
>
> As some of you suggested, I find it surprising that after installing FreeTDS and referencing it when I was installing it using --with-sybase=/usr/local/freetds option when I installed the PHP, it kept on bringing me back errors saying that it cannot find it. I am not sure if it is the cause of why I still cannot connect. As for my php.info, I tried to run the search to find mssql values, but I cannot find any.
>
> Is this the reason why I still cannot connect to a different machine to its MS SQL using PHP? Have I missed something in my setup or something?
> Note: The setup for the database is accessible by another computer using the same server passwords, etc.
>
> I welcome any suggestions on t his.
>
> Alice
> ======================================================
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
> ________________________________________
> From: Olavi ivask [olavi@city.ee]
> Sent: Thursday, June 12, 2008 2:20 PM
> To: Wei, Alice J.
> Cc: php-db@lists.php.net
> Subject: RE: [PHP-DB] PHP to MS SQL Package
>
> Hello,
>
> Here is a good article about ms-sql & PHP on Linux
> (http://www.devarticles.com/index2.php?option=content&task=v iew&id=667&pop=1&page=0&hide_js=1)
>
>
> Olavi Ivask
> On Thu, 2008-06-12 at 13:43 -0400, Wei, Alice J. wrote:
>> Hi,
>>
>> After stopping the Apache server, I reinstalled PHP by adding the line you had below, and then restarted Apache.
>>
>> ./configure
>> --with-apxs2=/usr/local/apache/bin/apxs \
>> --with-sybase=/usr/local/freetds
>> --prefix=/usr/local/apache/php \
>> make
>> make install
>>
>> After this has been completed, I am still getting the same error about how the function is not defined.
>>
>> Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
>>
>> Could there be other options? Or, am I missing something here?
>>
>> Alice
>> ======================================================
>> Alice Wei
>> MIS 2009
>> School of Library and Information Science
>> Indiana University Bloomington
>> ajwei@indiana.edu
>> ________________________________________
>> From: Olavi ivask [olavi@city.ee]
>> Sent: Thursday, June 12, 2008 12:57 PM
>> To: Wei, Alice J.
>> Cc: php-db@lists.php.net
>> Subject: Re: [PHP-DB] PHP to MS SQL Package
>>
>> Hi,
>>
>> you need to install "freetds" before compiling php.
>>
>> compile php:
>>
>> ./configure [--with-apxs --with-mysql...]
>> --with-sybase=/usr/local/freetds
>> make
>> make install
>>
>> Olavi Ivask
>>
>> On Thu, 2008-06-12 at 12:14 -0400, Wei, Alice J. wrote:
>> > Hi,
>> >
>> > I am currently using a Linux box with Fedora 9.0 and I am trying to connect PHP to a MS SQL database. All the permissions on the MS SQL database is up to date and accurate, but I consistently get errors that say
>> >
>> > PHP Fatal error: Call to undefined function mssql_connect() in /usr/local/apache/htdocs/create_new_entry_master.php on line 20
>> >
>> > I have looked into the options of using FreeBSD, as suggested on the http://us3.php.net/manual/en/function.mssql-connect.php#8319 6, but I am not sure if I could use it since I don't use a Windows Machine to run my PHP.
>> > Does anyone have any suggestions?
>> >
>> > Alice
>> > ======================================================
>> > Alice Wei
>> > MIS 2009
>> > School of Library and Information Science
>> > Indiana University Bloomington
>> > ajwei@indiana.edu
>> >
>>
>>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--

Naturally, the common people don't want war, but they can always be
brought to the bidding of the leaders. Tell them they are being
attacked, and denounce the pacifists for lack of patriotism and
endangering the country. It works the same in every country.

--- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: PHP to MS SQL Package

am 13.06.2008 15:23:15 von ajwei

Hi,

I have changed the freetds.conf file at the server section to the followi=
ng:

# A typical Microsoft server
[egServer70]
host =3D 192.168.10.129
port =3D 1433
tds version =3D 4.2

I noticed that the pinging and telnet to the server is error free like ever=
ything else you suggested below. However, I did notice that on my PHP conf=
iguration page, I see no information with MS SQL on the page like Gary desc=
ribed in another post. I am not sure if I would see this to make sure that =
my PHP would be able to connect to the MS SQL server. I did notice that aft=
er having added the above lines, it does not take as long for me to see tha=
t it is not connected to the server.

I have made attempts to have another person use another programming languag=
e to connect using the same user name and password, and he could connect an=
d I could not.
Are there other things I might have missed?

Alice
==================== =====3D=
==================== =====3D=
====
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
ajwei@indiana.edu
________________________________________
From: Ken Keefe [kjkeefe@gmail.com]
Sent: Thursday, June 12, 2008 6:04 PM
To: Wei, Alice J.
Cc: Olavi ivask; php-db@lists.php.net
Subject: Re: [PHP-DB] PHP to MS SQL Package

That error message tells you that you are getting closer. Next step
would be to make sure you have a connection to that system:

$ ping 192.168.10.128

Next thing I would do is see if that port is open on the server:

$ telnet 192.168.10.128 1433

If it says something about "Escape character is ..." then the SQL
server is listening and no firewalls or anything are getting in the
way.

Finally, you probably need to add an entry at the bottom of your
/etc/freetds/freetds.conf file that looks like this:

[SomeNameForTheServer]
host =3D 192.168.10.128
port =3D 1433
tds version =3D 8.0

Then, in your php code, use the name you give (SomeNameForTheServer)
as the host instead of the IP address.

Good luck.

Ken

On Thu, Jun 12, 2008 at 3:53 PM, Wei, Alice J. wrote:
> Hi,
>
> I hope this would allow me to address this problem to a step further now=
..
> After getting FreeTDS installed, my error has now moved away from the un=
defined function level.
> I have looked through the PHP help from http://us3.php.net/manual/en/fun=
ction.mssql-connect.php, and configured according to what has been listed i=
n the user commentsThis is my error now:
>
> PHP Warning: mssql_connect(): Unable to connect to server: 192.168.10=
..128 in /usr/local/apache/htdocs/test.php on line 22
>
> As some of you suggested, I find it surprising that after installing Fr=
eeTDS and referencing it when I was installing it using --with-sybase=3D/us=
r/local/freetds option when I installed the PHP, it kept on bringing me bac=
k errors saying that it cannot find it. I am not sure if it is the cause of=
why I still cannot connect. As for my php.info, I tried to run the search =
to find mssql values, but I cannot find any.
>
> Is this the reason why I still cannot connect to a different machine to=
its MS SQL using PHP? Have I missed something in my setup or something?
> Note: The setup for the database is accessible by another computer usin=
g the same server passwords, etc.
>
> I welcome any suggestions on t his.
>
> Alice
> ==================== =====
==================== =====3D=
=====3D
> Alice Wei
> MIS 2009
> School of Library and Information Science
> Indiana University Bloomington
> ajwei@indiana.edu
> ________________________________________
> From: Olavi ivask [olavi@city.ee]
> Sent: Thursday, June 12, 2008 2:20 PM
> To: Wei, Alice J.
> Cc: php-db@lists.php.net
> Subject: RE: [PHP-DB] PHP to MS SQL Package
>
> Hello,
>
> Here is a good article about ms-sql & PHP on Linux
> (http://www.devarticles.com/index2.php?option=3Dcontent&task =3Dview&id=3D=
667&pop=3D1&page=3D0&hide_js=3D1)
>
>
> Olavi Ivask
> On Thu, 2008-06-12 at 13:43 -0400, Wei, Alice J. wrote:
>> Hi,
>>
>> After stopping the Apache server, I reinstalled PHP by adding the line=
you had below, and then restarted Apache.
>>
>> ./configure
>> --with-apxs2=3D/usr/local/apache/bin/apxs \
>> --with-sybase=3D/usr/local/freetds
>> --prefix=3D/usr/local/apache/php \
>> make
>> make install
>>
>> After this has been completed, I am still getting the same error about=
how the function is not defined.
>>
>> Fatal error: Call to undefined function mssql_connect() in /usr/local/a=
pache/htdocs/create_new_entry_master.php on line 20
>>
>> Could there be other options? Or, am I missing something here?
>>
>> Alice
>> ==================== =====
==================== =====3D=
=====3D
>> Alice Wei
>> MIS 2009
>> School of Library and Information Science
>> Indiana University Bloomington
>> ajwei@indiana.edu
>> ________________________________________
>> From: Olavi ivask [olavi@city.ee]
>> Sent: Thursday, June 12, 2008 12:57 PM
>> To: Wei, Alice J.
>> Cc: php-db@lists.php.net
>> Subject: Re: [PHP-DB] PHP to MS SQL Package
>>
>> Hi,
>>
>> you need to install "freetds" before compiling php.
>>
>> compile php:
>>
>> ./configure [--with-apxs --with-mysql...]
>> --with-sybase=3D/usr/local/freetds
>> make
>> make install
>>
>> Olavi Ivask
>>
>> On Thu, 2008-06-12 at 12:14 -0400, Wei, Alice J. wrote:
>> > Hi,
>> >
>> > I am currently using a Linux box with Fedora 9.0 and I am trying to =
connect PHP to a MS SQL database. All the permissions on the MS SQL databas=
e is up to date and accurate, but I consistently get errors that say
>> >
>> > PHP Fatal error: Call to undefined function mssql_connect() in /usr/l=
ocal/apache/htdocs/create_new_entry_master.php on line 20
>> >
>> > I have looked into the options of using FreeBSD, as suggested on the h=
ttp://us3.php.net/manual/en/function.mssql-connect.php#83196 , but I am not=
sure if I could use it since I don't use a Windows Machine to run my PHP.
>> > Does anyone have any suggestions?
>> >
>> > Alice
>> > ==================== ===3D=
==================== =====3D=
======
>> > Alice Wei
>> > MIS 2009
>> > School of Library and Information Science
>> > Indiana University Bloomington
>> > ajwei@indiana.edu
>> >
>>
>>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--

Naturally, the common people don't want war, but they can always be
brought to the bidding of the leaders. Tell them they are being
attacked, and denounce the pacifists for lack of patriotism and
endangering the country. It works the same in every country.

--- Herman Goering, Hitler's Reichsmarschall, At the Nuremberg Trials

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP to MS SQL Package

am 13.06.2008 17:12:52 von Dee Ayy

------=_Part_6663_30259622.1213369972948
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

http://php.he.net/manual/en/mssql.installation.php Installation

The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini.


To get these functions to work, you have to compile PHP with
--with-mssql[=DIR], where DIR is the FreeTDS install prefix. And FreeTDS
should be compiled using --enable-msdblib.

Did you actually do a compile
....
--with-mssql=/usr/local/freetds
....

I saw you asked " ./configure [--with-apxs --with-mysql...]

You actually meant mssql, right?" But I didn't see a reply about that.

I searched for "--with-mssql" in my emails and did not see that in your
thread, but saw Claudio Saavedra's thread from Jan 12, 2007 'Problem with
PHP 4.4.4 and MSSQL in Centos' also mentioning "--with-sybase", but his
solution was "I fixed it by compiling again php with --with-mssql instead of
--with-sybase. Now it works perfectly".

So again, I'd recommend compiling "--with-mssql".

By the way anybody, why would I compile "--with-sybase" if I want to use
MSSQL commands?

I just checked my phpinfo on an install that has mysql and mssql. I don't
even see a --with-mysql or --with-mssql like on previous servers, but I see
"additional .ini files parsed" which mentions /etc/php.d/mssql.ini and
/etc/php.d/mysqli.ini.

Enjoy!

------=_Part_6663_30259622.1213369972948--