RE: [PHP-DB] PHP to MS SQL Package

2008-06-13 Thread Wei, Alice J.
Hi,

  I have changed the freetds.conf file at the server section to the following:

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

I noticed that the pinging and telnet to the server is error free like 
everything else  you suggested below. However, I did notice that on my PHP 
configuration page, I see no information with MS SQL on the page like Gary 
described 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 after 
having added the above lines, it does not take as long for me to see that it is 
not connected to the server.

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

Alice
==
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

From: Ken Keefe [EMAIL PROTECTED]
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 = 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. [EMAIL PROTECTED] 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
 [EMAIL PROTECTED]
 
 From: Olavi ivask [EMAIL PROTECTED]
 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=contenttask=viewid=667pop=1page=0hide_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
 [EMAIL PROTECTED]
 
 From: Olavi ivask [EMAIL PROTECTED]
 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

Re: [PHP-DB] PHP to MS SQL Package

2008-06-13 Thread Dee Ayy
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!


Re: [PHP-DB] PHP to MS SQL Package

2008-06-12 Thread Olavi ivask
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#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
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]
 


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



RE: [PHP-DB] PHP to MS SQL Package

2008-06-12 Thread Wei, Alice J.

From: Olavi ivask [EMAIL PROTECTED]
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=/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#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
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]



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



Re: [PHP-DB] PHP to MS SQL Package

2008-06-12 Thread 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. [EMAIL PROTECTED] 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#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
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]

 --
 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-DB] PHP to MS SQL Package

2008-06-12 Thread Wei, Alice J.
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
[EMAIL PROTECTED]

From: Olavi ivask [EMAIL PROTECTED]
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#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
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]



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



RE: [PHP-DB] PHP to MS SQL Package

2008-06-12 Thread Wei, Alice J.

From: Ken Keefe [EMAIL PROTECTED]
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. [EMAIL PROTECTED] 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#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
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]

 --
 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-DB] PHP to MS SQL Package

2008-06-12 Thread Olavi ivask
Hello,

Here is a good article about ms-sql  PHP on Linux
(http://www.devarticles.com/index2.php?option=contenttask=viewid=667pop=1page=0hide_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
 [EMAIL PROTECTED]
 
 From: Olavi ivask [EMAIL PROTECTED]
 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#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
  ==
  Alice Wei
  MIS 2009
  School of Library and Information Science
  Indiana University Bloomington
  [EMAIL PROTECTED]
 
 
 


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



Re: [PHP-DB] PHP to MS SQL Package

2008-06-12 Thread 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:

?php phpinfo(); ?

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. [EMAIL PROTECTED] wrote:
 
 From: Ken Keefe [EMAIL PROTECTED]
 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. [EMAIL PROTECTED] 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#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
 ==
 Alice Wei
 MIS 2009
 School of Library and Information Science
 Indiana University Bloomington
 [EMAIL PROTECTED]

 --
 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-DB] PHP to MS SQL Package

2008-06-12 Thread Wei, Alice J.
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
[EMAIL PROTECTED]

From: Olavi ivask [EMAIL PROTECTED]
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=contenttask=viewid=667pop=1page=0hide_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
 [EMAIL PROTECTED]
 
 From: Olavi ivask [EMAIL PROTECTED]
 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#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
  ==
  Alice Wei
  MIS 2009
  School of Library and Information Science
  Indiana University Bloomington
  [EMAIL PROTECTED]
 




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



Re: [PHP-DB] PHP to MS SQL Package

2008-06-12 Thread 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. [EMAIL PROTECTED] 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
 [EMAIL PROTECTED]
 
 From: Olavi ivask [EMAIL PROTECTED]
 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=contenttask=viewid=667pop=1page=0hide_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
 [EMAIL PROTECTED]
 
 From: Olavi ivask [EMAIL PROTECTED]
 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#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
  ==
  Alice Wei
  MIS 2009
  School of Library and Information Science
  Indiana University Bloomington
  [EMAIL PROTECTED]
 




 --
 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