[PHP-DB] php and mssql on seperate servers
I'm new to PHP and having issues. We have seperate servers for them. We can use ODBC to test the connection and it works fine. However, when we try to run the site we get a message of *** Error: Unable to Connect to Database. Please Try Again Later. *** We are using a custom app that we aren't getting a lot of assistance with. The relevant lines in the app are: define(DBHOST, //database server name); define(DBUSER, user); define(DBPASS, password); if(!$dbCon=mssql_connect(DBHOST,DBUSER,DBPASS)) $error = Unable to Connect to Database. Please Try Again Later.; Can anyone assist a noob php user? thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP and MSSQL on Linux
I originally posted this to the general discussion but wanted to see if anyone on this list had an idea. The issue is trying to connect to the MSSQL with PHP from a linux box (Fedora Core 4 in this instance) An interesting development. I found some reference to running my PHP script from the command line to take Apache out of the picture. Lo and behold, the script worked. I was able to connect to the server. So the issue seems to be related with Apache. Any idea what I would need to do there to make the script work via the web? Robbert [EMAIL PROTECTED] wrote on 11/02/2005, 05:50:01 PM: Thanks for your help. I'd love to hear if you have any success with the RPMs. Something I've seen over and over again in the documentation is the compilation of php adding --with-mssql. My PHP info output does not include that marker. The output is as follows './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' Howver, under additional .ini files parsed, I see the mssql file: /etc/php.d/ldap.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini And further on down are the mssql configuration settings. Rick Emery wrote on 11/02/2005, 05:19:06 PM: Quoting [EMAIL PROTECTED]: Yup, I thought that was the problem too but when I added my server to the conf file, there was no change. When you set up your MSSQL connection in fedora, did you install anything else other than MSSQL and PHP-MSSQL? Or did you have to set anything in your php.ini file to use the new extension? Well, I didn't have the rpms; I compiled from source. I don't have that box available anymore, but I've checked my notes. First, I compiled freetds (nothing special in the configure line), then I compiled php using --with-mssql=/usr (to point to the freetds libraries). All of this should have been handled within the rpms, though, and if phpinfo is showing the mssql extension loaded, I'm not sure why it wouldn't be working. I don't remember modifying php.ini at all for the mssql stuff. Hopefully over the next couple of days I'll have some time to set up a test box and try the rpms to which you pointed me, to see if I run into the same trouble. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and MSSQL on Linux
Run it from the command line as the apache user. See if that makes a difference. I'd guess not though. Apache's php module doesn't really put any restrictions that I know of on the scripting.. that's a strange effect.. On Wednesday 02 November 2005 10:54 am, [EMAIL PROTECTED] wrote: I originally posted this to the general discussion but wanted to see if anyone on this list had an idea. The issue is trying to connect to the MSSQL with PHP from a linux box (Fedora Core 4 in this instance) An interesting development. I found some reference to running my PHP script from the command line to take Apache out of the picture. Lo and behold, the script worked. I was able to connect to the server. So the issue seems to be related with Apache. Any idea what I would need to do there to make the script work via the web? Robbert [EMAIL PROTECTED] wrote on 11/02/2005, 05:50:01 PM: Thanks for your help. I'd love to hear if you have any success with the RPMs. Something I've seen over and over again in the documentation is the compilation of php adding --with-mssql. My PHP info output does not include that marker. The output is as follows './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' Howver, under additional .ini files parsed, I see the mssql file: /etc/php.d/ldap.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini And further on down are the mssql configuration settings. Rick Emery wrote on 11/02/2005, 05:19:06 PM: Quoting [EMAIL PROTECTED]: Yup, I thought that was the problem too but when I added my server to the conf file, there was no change. When you set up your MSSQL connection in fedora, did you install anything else other than MSSQL and PHP-MSSQL? Or did you have to set anything in your php.ini file to use the new extension? Well, I didn't have the rpms; I compiled from source. I don't have that box available anymore, but I've checked my notes. First, I compiled freetds (nothing special in the configure line), then I compiled php using --with-mssql=/usr (to point to the freetds libraries). All of this should have been handled within the rpms, though, and if phpinfo is showing the mssql extension loaded, I'm not sure why it wouldn't be working. I don't remember modifying php.ini at all for the mssql stuff. Hopefully over the next couple of days I'll have some time to set up a test box and try the rpms to which you pointed me, to see if I run into the same trouble. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP-DB] PHP and MSSQL on Linux
I have the freetds installed and am able to communicate with MSSQL, but only when i run the script from the command line. When I run it from a webbrowser, it fails. Robbert Joseph Crawford [EMAIL PROTECTED] wrote on 11/02/2005, 08:00:43 PM: I attempted this a while back for a client who used a 3rd party database to get thier content, the database was on a windows machine and MSSQL, however they ended up not being able to fully fund the project so gave up. I did find one thing that you had to install on linux to get linux to communicate with MSSQL however when i talked with a lot of hosts they would not install it because it had security flaws and has not been updated in years. To furthur this project we would have to get a dedicated server and install the package that was needed http://www.freetds.org/ I tried many things but i could not get php to communicate with MSSQL on a windows machine without the use of FreeTDS and even then it seemed to be particularly difficult, had to tweak stuff to get it initially installed. I hope this helps :) -- Joseph Crawford Jr. Zend Certified Engineer Codebowl Solutions, Inc. 1-802-671-2021 [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP-DB] PHP and MSSQL on Linux
I ran it as the apache user and it worked fine (from the command line). I do notice that when I run a system command using the exec or system functions, I get nothing back on some of the commands (primarily traceroute and ping). Others do work (whoami) Robbert Micah Stevens [EMAIL PROTECTED] wrote on 11/02/2005, 07:58:55 PM: Run it from the command line as the apache user. See if that makes a difference. I'd guess not though. Apache's php module doesn't really put any restrictions that I know of on the scripting.. that's a strange effect.. On Wednesday 02 November 2005 10:54 am, [EMAIL PROTECTED] wrote: I originally posted this to the general discussion but wanted to see if anyone on this list had an idea. The issue is trying to connect to the MSSQL with PHP from a linux box (Fedora Core 4 in this instance) An interesting development. I found some reference to running my PHP script from the command line to take Apache out of the picture. Lo and behold, the script worked. I was able to connect to the server. So the issue seems to be related with Apache. Any idea what I would need to do there to make the script work via the web? Robbert [EMAIL PROTECTED] wrote on 11/02/2005, 05:50:01 PM: Thanks for your help. I'd love to hear if you have any success with the RPMs. Something I've seen over and over again in the documentation is the compilation of php adding --with-mssql. My PHP info output does not include that marker. The output is as follows './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' Howver, under additional .ini files parsed, I see the mssql file: /etc/php.d/ldap.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini And further on down are the mssql configuration settings. Rick Emery wrote on 11/02/2005, 05:19:06 PM: Quoting [EMAIL PROTECTED]: Yup, I thought that was the problem too but when I added my server to the conf file, there was no change. When you set up your MSSQL connection in fedora, did you install anything else other than MSSQL and PHP-MSSQL? Or did you have to set anything in your php.ini file to use the new extension? Well, I didn't have the rpms; I compiled from source. I don't have that box available anymore, but I've checked my notes. First, I compiled freetds (nothing special in the configure line), then I compiled php using --with-mssql=/usr (to point to the freetds libraries). All of this should have been handled within the rpms, though, and if phpinfo is showing the mssql extension loaded, I'm not sure why it wouldn't be working. I don't remember modifying php.ini at all for the mssql stuff. Hopefully over the next couple of days I'll have some time to set up a test box and try the rpms to which you pointed me, to see if I run into the same trouble. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List
Re: [PHP-DB] PHP and MSSQL on Linux
System commands are supposed to output errors on STERR, not on STOUT, php's system commands only grab STOUT so if there's an error you'll get no output.. You need to redirect STERR to STOUT when you issue the command.. Just put this at the end of your command: 21 Don't know if that's the issue, but it sounds like it. -Micah On Wednesday 02 November 2005 11:36 am, [EMAIL PROTECTED] wrote: I ran it as the apache user and it worked fine (from the command line). I do notice that when I run a system command using the exec or system functions, I get nothing back on some of the commands (primarily traceroute and ping). Others do work (whoami) Robbert Micah Stevens [EMAIL PROTECTED] wrote on 11/02/2005, 07:58:55 PM: Run it from the command line as the apache user. See if that makes a difference. I'd guess not though. Apache's php module doesn't really put any restrictions that I know of on the scripting.. that's a strange effect.. On Wednesday 02 November 2005 10:54 am, [EMAIL PROTECTED] wrote: I originally posted this to the general discussion but wanted to see if anyone on this list had an idea. The issue is trying to connect to the MSSQL with PHP from a linux box (Fedora Core 4 in this instance) An interesting development. I found some reference to running my PHP script from the command line to take Apache out of the picture. Lo and behold, the script worked. I was able to connect to the server. So the issue seems to be related with Apache. Any idea what I would need to do there to make the script work via the web? Robbert [EMAIL PROTECTED] wrote on 11/02/2005, 05:50:01 PM: Thanks for your help. I'd love to hear if you have any success with the RPMs. Something I've seen over and over again in the documentation is the compilation of php adding --with-mssql. My PHP info output does not include that marker. The output is as follows './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' Howver, under additional .ini files parsed, I see the mssql file: /etc/php.d/ldap.ini, /etc/php.d/mssql.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini And further on down are the mssql configuration settings. Rick Emery wrote on 11/02/2005, 05:19:06 PM: Quoting [EMAIL PROTECTED]: Yup, I thought that was the problem too but when I added my server to the conf file, there was no change. When you set up your MSSQL connection in fedora, did you install anything else other than MSSQL and PHP-MSSQL? Or did you have to set anything in your php.ini file to use the new extension? Well, I didn't have the rpms; I compiled from source. I don't have that box available anymore, but I've checked my notes. First, I compiled freetds (nothing special in the configure line), then I compiled php using --with-mssql=/usr (to point to the freetds libraries). All of this should have been handled within the rpms, though, and if phpinfo is showing the mssql extension loaded, I'm not sure why it wouldn't be working. I don't remember modifying php.ini at all for the mssql stuff. Hopefully over the next couple of days I'll have some time to set up a
[PHP-DB] PHP and MSSQL
hi, I have been learning PHP and MySQL from a book that I have bought. I am really pleased with the way these 2 systems work, but I was wondering if MSSQL wouldn't be easier to use, more specifically I was wondering wether I could make an Access Database and connect it to my php website using MSSQL. I heard it would be possible And now I ask the experts... :-) grtz DragonEye -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] PHP and MSSQL
yes, it's possible. I'm learning php myself. (I'm a CF junkie.) I got this script from somewhere. I have the info on a backup CD at home. I'll post it if you're having problems with the script below. (I did a google for: ODBC connection mySQL, or something similar to that.) The script below is what I adapted for my purposes. You have to go to (I'm using Win2000, yours would be similar, but necessarily the same) START CONTROL PANEL ADMINISTRATIVE TOOLS DATA SOURCES (ODBC) SYSTEM DSN : ADD [select Access]; enter the name; click select and give the path to your db. Once again, if you're not using Win2000 the above will be slightly different. The php is below: ?php function monthly() { /* Make the connection to the database. The syntax is odbc_connect( 'SYSTEM_DSN' , 'USER', 'PASSWORD' ); $cnx will hold the pconnect is used to establish a persistent database connection to the Database until the procedure is completed. */ $cnx = odbc_connect( 'SYSTEM_DSN' , 'root', '' ); if (!$cnx) { Error_handler( Error in odbc_connect , $cnx ); } // send a simple odbc query . returns an odbc cursor $cur= odbc_exec( $cnx, SELECT yourFieldName1, yourFieldName2, yourFieldName3 FROM table ); if (!$cur) { Error_handler( Error in odbc_exec( no cursor returned ) , $cnx ); } // fetch the succesive result rows while( odbc_fetch_row( $cur ) ) { $yourFieldName1= odbc_result( $cur, 1 ); $yourFieldName2= odbc_result( $cur, 2 ); $yourFieldName3= odbc_result( $cur, 3 ); echo $yourFieldName1 -- $yourFieldName2 -- $yourFieldName3br ; } // close the connection. important if persistent connection are On odbc_close( $cnx); } ? html head title/title link href=internal.css title=new type=text/css rel=stylesheet style /style /head body div id=left?php include (nav.php); ?/div div id=center ?php monthly(); ? /div /body /html --glm -Original Message- From: DragonEye WebDesign [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 31, 2003 4:08 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP and MSSQL hi, I have been learning PHP and MySQL from a book that I have bought. I am really pleased with the way these 2 systems work, but I was wondering if MSSQL wouldn't be easier to use, more specifically I was wondering wether I could make an Access Database and connect it to my php website using MSSQL. I heard it would be possible And now I ask the experts... :-) grtz DragonEye -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -Original Message- From: DragonEye WebDesign [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 31, 2003 4:08 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP and MSSQL hi, I have been learning PHP and MySQL from a book that I have bought. I am really pleased with the way these 2 systems work, but I was wondering if MSSQL wouldn't be easier to use, more specifically I was wondering wether I could make an Access Database and connect it to my php website using MSSQL. I heard it would be possible And now I ask the experts... :-) grtz DragonEye -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP 4.3.0 + MSSQL database authenticationproblem?
Hi Alan, If this is a problem with PHP it's in the Sybase extension. I hvae not tried working with that since I made it possible to use --with-mssql (and I'm not the maintainer). Can you compile the cli version (--disable-cgi --with-mssql=path/to/freetds ...) and test a small comanndline script using the mssql_*() functions ? This should work with php 4.3.0, but I have made a few changes to the code in CVS and I can send you the latest files if you need them. This configuration is tested on sevral different Linux configurations and I use it every day so I know it works :-) - Frank Hi Frank, --- Frank M. Kromann [EMAIL PROTECTED] wrote: This should be ok. --with-tdsver=4.2 sets the default. I figured as much, since I think the default can be overridden in the 'freetds.conf' and/or $TDSVER environment variable, no? Have you tried the tsql tool to see if you can connect ? Yes, and connected was made successfully. I used the name of the connection in 'freetds.conf'. I was able to confirm successful connection earlier by posting some logs to the FreeTDS list. I am starting to to think it is more and more a PHP issue. The only thing I haven't tried yet is downgrading the PHP version to that which is on the current server (4.1.2; an attempted upgrade to v4.2.3 just before Xmas resulted ina very similar problem) If you plan to use stored procedures I would make Not as far as I know. Right now, it is only used to pull information from tables. Alan __ Post your free ad now! http://personals.yahoo.ca -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP 4.3.0 + MSSQL database authentication problem?
Hello, Because I am not sure if this is just a PHP issue or a PHP+DB issue, I will be posting this message (seperately) to bith the General and PHP-DB lists. First, a brief rundown of my setup: Mandrake Linux 9.0 Apache 1.3.27 PHP 4.3.0 We are in the process of rebuilding our outdated servers, and all sites have been moved over successfully, except our own, which has a Control Panel login. The login authentication is done using FreeTDS to an MSSQL 2000 database. This setup works fine on the current server, but when I test it on the new server, the authentication seems to work fine, but instead of the screen I normally see when logging in, I just get kicked back to the Control Panel login screen. At first, I suspected FreeTDS, but I have confirmed that a connection is definately being made by enabling and examining the dump file. The FreeTDS mailing list has confirmed that this is also the case. The current (working) server is running Apache 1.3.27 + PHP v4.1.2 . I had a similar problem on the current working server when I tried upgrading the PHP to v4.2.3 just before Xmas. I have not yet tried downgrading to v4.1.2 on the new server, and would rather not. :-) I am not really sure where to proceed from here. I can provide any further information you need, or can possibly provide a Test account if you wish to see for yourself what it is doing, which may give some ideas as to what is happening. Is there perhaps some logging variables I can enable in the Control Panel PHP script to see what is going on? Thank you, in advance, for your help and advice in this matter. Sincerely, Alan Murrell [EMAIL PROTECTED] __ Post your free ad now! http://personals.yahoo.ca -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP 4.3.0 + MSSQL database authenticationproblem?
Hi Alan, I'm not sure what 'Control Panel PHP script' means ? What version of FreeTDS are you using ? Do you use the sybase or the mssql extension in PHP ? - Frank Hello, Because I am not sure if this is just a PHP issue or a PHP+DB issue, I will be posting this message (seperately) to bith the General and PHP-DB lists. First, a brief rundown of my setup: Mandrake Linux 9.0 Apache 1.3.27 PHP 4.3.0 We are in the process of rebuilding our outdated servers, and all sites have been moved over successfully, except our own, which has a Control Panel login. The login authentication is done using FreeTDS to an MSSQL 2000 database. This setup works fine on the current server, but when I test it on the new server, the authentication seems to work fine, but instead of the screen I normally see when logging in, I just get kicked back to the Control Panel login screen. At first, I suspected FreeTDS, but I have confirmed that a connection is definately being made by enabling and examining the dump file. The FreeTDS mailing list has confirmed that this is also the case. The current (working) server is running Apache 1.3.27 + PHP v4.1.2 . I had a similar problem on the current working server when I tried upgrading the PHP to v4.2.3 just before Xmas. I have not yet tried downgrading to v4.1.2 on the new server, and would rather not. :-) I am not really sure where to proceed from here. I can provide any further information you need, or can possibly provide a Test account if you wish to see for yourself what it is doing, which may give some ideas as to what is happening. Is there perhaps some logging variables I can enable in the Control Panel PHP script to see what is going on? Thank you, in advance, for your help and advice in this matter. Sincerely, Alan Murrell [EMAIL PROTECTED] __ Post your free ad now! http://personals.yahoo.ca -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP 4.3.0 + MSSQL database authentication problem?
Hi Frank, --- Frank M. Kromann [EMAIL PROTECTED] wrote: I'm not sure what 'Control Panel PHP script' means ? I meant the PHP page itself that is the Control Panel (i.e., 's_controlpanel.php') What version of FreeTDS are you using ? 0.60 on the new server; I am not sure about the currently working server, but I think it is 0.50 or 0.51. Do you use the sybase or the mssql extension in PHP The Sybase one ('sybase_connect'). The PHP was compiled with the '--with-sybase=/path/to/freetds' option. Thanx! Alan __ Post your free ad now! http://personals.yahoo.ca -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP 4.3.0 + MSSQL database authenticationproblem?
Hi Alan, Did you configure FreeTDS with the right tdsver ? This can be none when compiling FreetTDS using --with-tdsver=7.0 or in freetds.conf. You should use the correct version according to your MSSQL server (70. = SQL Server 7, 80 = SQL Server 2000). From PHP 4.3.0 you can compile php using --with-mssql=/path/to/freetds. FreeTDS needs to be compiled with --enable-msdblib, and you need to change your code (sybase_* should be mssql_*). The upside is access to all the mssql_* functions. I'm using this on a Mandrake 9.0 system and it works fine (FreeTDS 0.61) - Frank Hi Frank, --- Frank M. Kromann [EMAIL PROTECTED] wrote: I'm not sure what 'Control Panel PHP script' means ? I meant the PHP page itself that is the Control Panel (i.e., 's_controlpanel.php') What version of FreeTDS are you using ? 0.60 on the new server; I am not sure about the currently working server, but I think it is 0.50 or 0.51. Do you use the sybase or the mssql extension in PHP The Sybase one ('sybase_connect'). The PHP was compiled with the '--with-sybase=/path/to/freetds' option. Thanx! Alan __ Post your free ad now! http://personals.yahoo.ca -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP 4.3.0 + MSSQL database authentication problem?
Hi Frank, --- Frank M. Kromann [EMAIL PROTECTED] wrote: This should be ok. --with-tdsver=4.2 sets the default. I figured as much, since I think the default can be overridden in the 'freetds.conf' and/or $TDSVER environment variable, no? Have you tried the tsql tool to see if you can connect ? Yes, and connected was made successfully. I used the name of the connection in 'freetds.conf'. I was able to confirm successful connection earlier by posting some logs to the FreeTDS list. I am starting to to think it is more and more a PHP issue. The only thing I haven't tried yet is downgrading the PHP version to that which is on the current server (4.1.2; an attempted upgrade to v4.2.3 just before Xmas resulted ina very similar problem) If you plan to use stored procedures I would make Not as far as I know. Right now, it is only used to pull information from tables. Alan __ Post your free ad now! http://personals.yahoo.ca -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] php with mssql
hello, I am trying to connect mssql with php, when I use mssql_pconnect(), It will fail to connect when the amount of visitors becomes large. But, when I use mssql_connect(), I can only run SELECT quern, while the INSERT/UPDATE staments doesn't work. Can somebody tell me why? thanks and sorry for my poor English :P -- Welcome to http://www.soff.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP and MSSQL using APACHE
Hello all: Just have been tasked to port an app created on (linux)php/mysql/apache to run (on Win2K) php/mssql/apache. Any links with info on setting up mssql to work with php and apache (all on win2k) appreciated! Luis __ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] php and mssql 8
is it possible to establish a connaction with php 4.0.4 to mssql server vers 8 ??? i've tried it serveral times but php alway crashes with the php_mssql70.dll extension - and the modul php_mssql from the 4.0.6 release doesn't work with php 4.04 is it there an other extension out there thanx cu -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] php and mssql 8
Sure, just use ODBC - it'll insulate you from issues like changing database versions and platforms. You can use native drivers or download ones from our site. Let me know if I can help. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: hausii [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 19, 2001 3:52 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] php and mssql 8 is it possible to establish a connaction with php 4.0.4 to mssql server vers 8 ??? i've tried it serveral times but php alway crashes with the php_mssql70.dll extension - and the modul php_mssql from the 4.0.6 release doesn't work with php 4.04 is it there an other extension out there thanx cu -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PHP-ODBC-MSSQL (Text type fields)
Hello Did anybody have problems with retrieving data from the fields of type Text.. ?php $dsn = dsn_database; $user = enduser; $pass = ; $query = usp_get_subj 10; $conn = odbc_connect($dsn, $user, $pass); $res = odbc_exec($conn, $query); while (odbc_fetch_row($res)) { //$data = odbc_field_type($res, 10); // text //$data = odbc_field_name($res, 10); // col_subj_content //$data = odbc_field_len($res, 10); // 2147483647 $data = odbc_result($res, col_subj_content); //$data = odbc_result($res, 10); echo $data; } odbc_close($conn); ? I can retrieve any other fields but not the field of type text.. What could be the problem? Thank you. Mike Michael Yevdokimov Web developer e-mail: [EMAIL PROTECTED] Globalocity B.V. Tel.: +31 (0)70 312 2814 Fax.: +31 (0)70 312 2808 http://www.globalocity.com e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PHP-ODBC-MSSQL (Text type fields) PART II
Hi I found an interesting thing.. But it will just make my work much harder.. comparing to ASP... :o (which I already am not able to use in the project we should deliver to our customer in a few weeks :o ?php // database settings $dsn = dsn_database; $user = enduser; $pass = ; $query = EXEC usp_get_subj 10; /* $query = SELECTcol_subj_id, col_cat_id, col_lang_id, col_subj_class, col_subj_owner_id, col_subj_secur, col_subj_last_update, col_subj_title, --varchar(512) col_subj_reg_page, --varchar(128) col_subj_content, -- text(16) col_subj_keywords --varchar(256) FROM tbl_subject WHERE col_subj_id = 10; */ $conn = odbc_connect($dsn, $user, $pass); $res = odbc_exec($conn, $query); $data = odbc_result($res, col_subj_content); $data = odbc_result($res, 8); echo $data; odbc_close($conn); ? This code will not retrieve the data from col_subj_content.. But!! If I replace the call of the stored procedure by the same its content but as an obviouse SQL query, everything will work and I will get the content of this field.. Hmm... So, what is the hell is that??? Could anyone HELP me to use the calls of sp way in the right way?!? ?php // database settings $dsn = dsn_database; $user = enduser; $pass = ; $query = SELECTcol_subj_id, col_cat_id, col_lang_id, col_subj_class, col_subj_owner_id, col_subj_secur, col_subj_last_update, col_subj_title, --varchar(512) col_subj_reg_page, --varchar(128) col_subj_content, -- text(16) col_subj_keywords --varchar(2560 FROM tbl_subject WHERE col_subj_id = 10; $conn = odbc_connect($dsn, $user, $pass); $res = odbc_exec($conn, $query); $data = odbc_result($res, col_subj_content); $data = odbc_result($res, 8); echo $data; odbc_close($conn); ? The stored procedure is: Create Procedure usp_get_subj ( @subj_id int ) As SELECT col_subj_id, col_cat_id, col_lang_id, col_subj_class, col_subj_owner_id, col_subj_secur, col_subj_last_update, col_subj_title, --varchar(512) col_subj_reg_page, --varchar(128) col_subj_content, -- text(16) col_subj_keywords --varchar(2560 FROM tbl_subject WHERE col_subj_id = @subj_id RETURN Michael Yevdokimov Web developer e-mail: [EMAIL PROTECTED] Globalocity B.V. Tel.: +31 (0)70 312 2814 Fax.: +31 (0)70 312 2808 http://www.globalocity.com e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PHP-ODBC-MSSQL PartII
The error which occures during the call of stored procedure is: Warning: SQL error: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index, SQL state S1002 in SQLGetData in d:\Inetpub\wwwroot\local_test\test.php on line 43 Michael Yevdokimov Web developer e-mail: [EMAIL PROTECTED] Globalocity B.V. Tel.: +31 (0)70 312 2814 Fax.: +31 (0)70 312 2808 http://www.globalocity.com e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PHP-ODBC-MSSQL (NT) PART 3
Ok.. I discovered also that everything will work pretty good.. But!! The field on type text should be ALWAYS the LAST in the model of the table.. Otherwise, it will not work what happens in my case.. Good night! Mike Michael Yevdokimov Web developer e-mail: [EMAIL PROTECTED] Globalocity B.V. Tel.: +31 (0)70 312 2814 Fax.: +31 (0)70 312 2808 http://www.globalocity.com e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP+Linux+MSSQL
On Friday 22 June 2001 15:03, Martin Pavlas wrote: Hi all, I'm totaly lost. I have a Linux server (Debian Potato), which runs Apache (1.3.14) + PHP (4.0.5) and MySQL (3.23.39). Now, I need to connect to other machine (NT) which runs MS SQL 7 and I need to insert some data to this machine. I'll read this data from my MySQL and I need to store them to the MS SQL. The data will be text strings, date, integers, real (not blobs or any binary data). So, I need to compile PHP to be able to connect to this MS SQL machive. But I don't know how to do it. Should I do it via native MS SQL functions (and driver) or via ODBC? The speed won't be so critical, because the PHP will connect to MS SQL eg. every 30 minutes and copy some data from the MySQL. (Well, I need to replicate MySQL db to the MSSQL db - so every 30 minutes I'll send there only the new records). - What can you recommend? ODBC or native functions? - What is the difference between UnixODBC and iODBC? Which one I should use? - I found FreeTDS and Sybase drivers. Which one is better and more reliable? The goal is to replicate MySQL to MS SQL (only some tables) and it does not matter if it is done via ODBC or native functions, but it must be done. Thanks for your help. freetds is good (better than odbc) regards, peco -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] PHP+Linux+MSSQL
Hi all, I'm totaly lost. I have a Linux server (Debian Potato), which runs Apache (1.3.14) + PHP (4.0.5) and MySQL (3.23.39). Now, I need to connect to other machine (NT) which runs MS SQL 7 and I need to insert some data to this machine. I'll read this data from my MySQL and I need to store them to the MS SQL. The data will be text strings, date, integers, real (not blobs or any binary data). So, I need to compile PHP to be able to connect to this MS SQL machive. But I don't know how to do it. Should I do it via native MS SQL functions (and driver) or via ODBC? The speed won't be so critical, because the PHP will connect to MS SQL eg. every 30 minutes and copy some data from the MySQL. (Well, I need to replicate MySQL db to the MSSQL db - so every 30 minutes I'll send there only the new records). - What can you recommend? ODBC or native functions? - What is the difference between UnixODBC and iODBC? Which one I should use? - I found FreeTDS and Sybase drivers. Which one is better and more reliable? The goal is to replicate MySQL to MS SQL (only some tables) and it does not matter if it is done via ODBC or native functions, but it must be done. Thanks for your help. -- Martin Pavlas ParsCom IS s.r.o. http://www.parscom.cz -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] php/linux/mssql
-Original Message- From: Miles Scruggs [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 11:17 AM To: PHP Mailing Subject: FW: [PHP-DB] php/linux/mssql Well from what I can tell php treats sybase and mssql the same. Am I wrong on this, or how do I fix this? That's correct... I have setp php/linux/mssql and everything works except the MS SQL connection. I don't get any errors returned to me, but it doesn't connect. As far as I can tell it doesn't even try, but I can't tell at what point it is breaking. I have used the freetds 0.51 libs to make this connection since I can't get the sybase libs. Here is what I have installed php-4.0.4pl1 apache_1.3.14 freetds-0.51 mysql-3.22.32 (connection to mysql works fine) On a remote site I have MS SQL server 2000 installed [ snip ] So I don't get an error until I try to select a db. I run tcpdump at the same time just to make sure that it wasn't trying to connect to the remote server and there was no attempt to even make a connection. Have you tried running a 'make check' in your FreeTDS directory to run the library's self-tests? I know I had to tweak a couple of things before I got PHP to work with a MS SQL server, and most of them came in the stages of getting FreeTDS working correctly before I even tried to build it into PHP. Is your SYBASE environment variable set correctly? Have you double-checked the sybase-related settings in your php.ini? Are you using the --enable-dbmfix flag for configure when building FreeTDS? (If so, have you made the appropriate changes in PHP's code or applied the patches from the FreeTDS website?) --- Mark Roedel ([EMAIL PROTECTED]) || "There cannot be a crisis next week. Systems Programmer / WebMaster || My schedule is already full." LeTourneau University ||-- Henry Kissinger -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] php/linux/mssql
So I don't get an error until I try to select a db. I run tcpdump at the same time just to make sure that it wasn't trying to connect to the remote server and there was no attempt to even make a connection. Have you tried running a 'make check' in your FreeTDS directory to run the library's self-tests? I know I had to tweak a couple of things before I got PHP to work with a MS SQL server, and most of them came in the stages of getting FreeTDS working correctly before I even tried to build it into PHP. Ok you are right make check failed here is a dump of the failure creating t0006 make check-TESTS make[7]: Entering directory `/usr/local/src/freetds-0.51/src/tds/unittests' t0001.c: Testing login, logout connect: Network is unreachable tds_connect() failed try_tds_login() failed FAIL: t0001 t0002.c: Test basic submit query, results connect: Network is unreachable tds_connect() failed try_tds_login() failed FAIL: t0002 t0003.c: Testing DB change -- 'use tempdb' connect: Network is unreachable tds_connect() failed try_tds_login() failed FAIL: t0003 t0004.c: Test large (512 bytes) queries connect: Network is unreachable tds_connect() failed try_tds_login() failed FAIL: t0004 t0005.c: Test large (512 bytes) replies connect: Network is unreachable tds_connect() failed try_tds_login() failed FAIL: t0005 t0006.c: Test SYBREAL, SYBFLT8 values connect: Network is unreachable tds_connect() failed try_tds_login() failed FAIL: t0006 === 6 of 6 tests failed === I'm not to sure why I would get "Network is unreachable" I can reach the outside network just fine. Where do I find out where it is trying to connect and how? Is your SYBASE environment variable set correctly? Have you double-checked the sybase-related settings in your php.ini? Are you using the --enable-dbmfix flag for configure when building FreeTDS? (If so, have you made the appropriate changes in PHP's code or applied the patches from the FreeTDS website?) I did compile FreeTDS with --enable-dbmfix flag, but I can't find any information on this patch that you are talking about. Should I just not use this flag? Miles Scruggs -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]