So what does this mean? The tutorial (http://kb.mediatemple.net
Main Topics
Browse All TopicsI am trying to use this tutorial (http://kb.mediatemple.net
Warning: odbc_connect() [function.odbc-connect]: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect
I removed FreeTDS by running '[root@deep] /#rpm -e freetds-0.63-1.1.el3.rf.i3
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
So what does this mean? The tutorial (http://kb.mediatemple.net
You took wrong path. Correct is here:
http://php.net/mssql
I tried it and it still does not work. During the installation, the only part where I don't receive any confirmation as to the command being successful is when I type 'odbcinst -i -s -f /opt/tds.datasource.DBNAME
[Sun May 11 04:14:11 2008] [notice] mod_python: Creating 4 session mutexes based on 50 max processes and 0 max threads.
[Sun May 11 04:14:11 2008] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun May 11 04:14:11 2008] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
[Sun May 11 04:14:11 2008] [warn] Init: SSL server IP/port conflict: default-72-47-216-93:443 (/etc/httpd/conf.d/zz010_p
[Sun May 11 04:14:11 2008] [warn] Init: SSL server IP/port conflict: relogistechs.com:443 (/var/www/vhosts/relogiste
[Sun May 11 04:14:11 2008] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Sun May 11 04:14:11 2008] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Mon May 12 01:16:26 2008] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon May 12 01:28:30 2008] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon May 12 02:33:14 2008] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
Yes, it is available here: http://relogistechs.com/co
What do you mean by "install php-mssql?" Do you mean to do something like this: http://www.howtoforge.com/
Do you mean to install a php-mssql .RPM such as this one, http://rpm.pbone.net/index
I have already installed Yum and have used it to install FreeTDS; however, the problem persists. What should I do so I don't get the error: odbc_connect() [function.odbc-connect]: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect
If by the providers help page, you mean this: http://kb.mediatemple.net/
Could you please elaborate (perhaps, with instructions) on how to "... test DB connection from standalone PHP" as I don't seem to understand. Are you also suggesting that I don't use this tutorial (http://kb.mediatemple.net
I installed it - now what? Can I use these functions (on a remote DB): http://us.php.net/mssql_co
This is what my php.ini file looks like; and oddly enough - I have another php.ini file that is titled "php.ini.saved_by_psa" (attached):
error severity to display.
mssql.min_error_severity = 10
; Minimum message severity to display.
mssql.min_message_severity
; Compatibility mode with old versions of PHP 3.0.
mssql.compatability_mode = Off
; Connect timeout
;mssql.connect_timeout = 5
; Query timeout
;mssql.timeout = 60
; Valid range 0 - 2147483647. Default = 4096.
;mssql.textlimit = 4096
; Valid range 0 - 2147483647. Default = 4096.
;mssql.textsize = 4096
; Limits the number of records in each batch. 0 = all records in one batch.
;mssql.batchsize = 0
; Specify how datetime and datetim4 columns are returned
; On => Returns data converted to SQL server settings
; Off => Returns values as YYYY-MM-DD hh:mm:ss
;mssql.datetimeconvert = On
; Use NT authentication when connecting to the server
mssql.secure_connection = Off
; Specify max number of processes. -1 = library default
; msdlib defaults to 25
; FreeTDS defaults to 4096
;mssql.max_procs = -1
; Specify client character set.
; If empty or not set the client charset from freetds.comf is used
; This is only used when compiled with FreeTDS
;mssql.charset = "ISO-8859-1"
[Assertion]
; Assert(expr); active by default.
;assert.active = On
; Issue a PHP warning for each failed assertion.
;assert.warning = On
; Don't bail out by default.
;assert.bail = Off
; User-function to be called if an assertion fails.
;assert.callback = 0
; Eval the expression with current error_reporting(). Set to true if you want
; error_reporting(0) around the eval().
;assert.quiet_eval = 0
[COM]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
;com.typelib_file =
; allow Distributed-COM calls
;com.allow_dcom = true
; autoregister constants of a components typlib on com_load()
;com.autoregister_typelib = true
; register constants casesensitive
;com.autoregister_casesens
; show warnings on duplicate constant registrations
;com.autoregister_verbose = true
[mbstring]
; language for internal character representation.
;mbstring.language = Japanese
; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
;mbstring.internal_encodin
; http input encoding.
;mbstring.http_input = auto
; http output encoding. mb_output_handler must be
; registered as output buffer to function
;mbstring.http_output = SJIS
; enable automatic encoding translation according to
; mbstring.internal_encoding
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
;mbstring.encoding_transla
; automatic encoding detection order.
; auto means
;mbstring.detect_order = auto
; substitute_character used when character cannot be converted
; one from another
;mbstring.substitute_chara
; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0
; enable strict encoding detection.
;mbstring.strict_encoding = Off
[FrontBase]
;fbsql.allow_persistent = On
;fbsql.autocommit = On
;fbsql.show_timestamp_deci
;fbsql.default_database =
;fbsql.default_database_pa
;fbsql.default_host =
;fbsql.default_password =
;fbsql.default_user = "_SYSTEM"
;fbsql.generate_warnings = Off
;fbsql.max_connections = 128
;fbsql.max_links = 128
;fbsql.max_persistent = -1
;fbsql.max_results = 128
[gd]
; Tell the jpeg decode to libjpeg warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
;gd.jpeg_ignore_warning = 0
[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
;exif.encode_unicode = ISO-8859-15
;exif.decode_unicode_motor
;exif.decode_unicode_intel
;exif.encode_jis =
;exif.decode_jis_motorola = JIS
;exif.decode_jis_intel = JIS
[Tidy]
; The path to a default tidy configuration file to use when using tidy
;tidy.default_config = /usr/local/lib/php/default
; Should tidy clean and repair output automatically?
; WARNING: Do not use this option if you are generating non-html content
; such as dynamic images
tidy.clean_output = Off
[soap]
; Enables or disables WSDL caching feature.
soap.wsdl_cache_enabled=1
; Sets the directory name where SOAP extension will put cache files.
soap.wsdl_cache_dir="/tmp"
; (time to live) Sets the number of second while cached file will be used
; instead of original one.
soap.wsdl_cache_ttl=86400
; Local Variables:
; tab-width: 4
; End:
; ImageMagick
extension=magickwand.so
I don't have any modules.ini file or any php_mssql modules in my /etc/php.d folder. The following is a list of all of the files in the folder:
dbase.ini
dom.ini
gd.ini
imap.ini
ioncube-loader.ini
json.ini
ldap.ini
mbstring.ini
mcrypt.ini
mssql.ini
mysql.ini
mysqli.ini
ncurses.ini
odbc.ini
pdo.ini
pdo_mysql.ini
pdo_odbc.ini
pdo_sqlite.ini
snmp.ini
xmlreader.ini
xmlrpc.ini
xmlwriter.ini
xsl.ini
zip.ini
Well, I suppose it shouldn't be so hard; but then again I am extremely new to all of this. So, when you say something like "examine suspect file if module is loaded" I have very little idea what you are talking about. You'll have to dumb it down for me as I am very new to this. Sorry for the misunderstanding.
When I use PHP-CLI to perform the command "php -e" the receive the following response:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/magi
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/php_
PHP Warning: PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
Thanks again for your help.
PHP Warning: PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
these are different revisons of PHP and extension. they are doomed to fail. Either update PHP or ger mssql module for running PHP.
I tried the commands; then it returned "Could not find update match for php. No Packages marked for Update/Obsoletion." Apparantly, the default Yum repositories on CentOS don't include php-mssql. So, I'm going to try following this tutorial (http://www.howtoforge.com
Type in browsers address bar (white rectangular area on top of topmost window in your internet program)
http://www.google.si/searc
your php and apache now are up to date as CentOS sees it.
check if php prints mssql-related errors - if so then php-mssql package is from different build and needs to be removed
rpm -e php-mssql
then use yum to install centos built version which should be consitent with your installed php.
now verify again - maybe some base tds libraries are non-centos and need to be reinstalled same way.
I tried connecting using my script and it was unsuccessful. Then, I checked the PHP error log (php -e) and it still says:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/magi
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/php_
PHP Warning: PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
So, I reinstalled php-mssql with Yum (after removing it with RPM) and tried testing the connection - it didn't work, then I checked the error log (above). This is the same error as before; however, I downloaded the new module so this shouldn't happen, right? Do you want me to try reinstalling FreeTDS? If so, do I just type 'yum install freetds'?
"ldd /usr/lib/php/modules/mssql
libsybdb.so.5 => /usr/lib/libsybdb.so.5 (0xb7f7e000)
libc.so.6 => /lib/libc.so.6 (0xb7e3e000)
/lib/ld-linux.so.2 (0xb7fe7000)
You might find this interesting... I don't really know what it means but you may find a relation: http://www.electrictoolbox
Web link provides build instructions. Basically rpmbuild does as described, and people at redhat and centos are quite aware of solution once they encounter problems.
Your PHP module dependencies are perfectly fine
http://php.net/manual/en/f
Please use tcp port for connection string, sometimes port is not present in /etc/services and shared sybase/mssql code called tds cannot guess
I havn't tried Telnet or Netcat - doesn't Telnet require there be something installed on the MSSQL server? Do you mean to look at the SQL logs on my server or on the MSSQL server? I would really like to figure out why I can't simply install this php-mssql extension on my server. Could you tell me why I don't have a file under /usr/src/redhat/SPECS/php.
One last question: My host recently updated the thread concerning issues with the MSSQL connectivity. The post:
"I was able to successfully install the FreeTDS RPM on a (dv) 3.5 after installing a backwards-compatibility package for readline, that will allow readline 4 to be accessed while readline 5 is installed.
The package I found (by searching rpmfind.net for libreadline.so.4) is located here:
ftp://rpmfind.net/linux/so
root@dv35 ~]# rpm -ihv readline-compat-4.3-307.i5
Preparing... ##########################
1:readline-compat ##########################
[root@dv35 ~]# rpm -Uhv freetds-0.63-1.1.el3.rf.i3
warning: freetds-0.63-1.1.el3.rf.i3
Preparing... ##########################
1:freetds ##########################
Hope this helps."
When I try to do this (rpm -Uhv freetds-0.63-1.1.el3.rf.i3
error: Failed dependencies:
libct.so.4 is needed by (installed) freetds-devel-0.64-11.el5.
libtds.so.5 is needed by (installed) freetds-devel-0.64-11.el5.
freetds = 0.64-11.el5.centos is needed by (installed) freetds-devel-0.64-11.el5.
Do I need to solve these dependencies and can't I just use Yum for this? Also, when I install "libct.so.4" I get an error depending on the install of "freetds = 0.64-11.el5.centos is needed by (installed) freetds-devel-0.64-11.el5.
Right now, if I run odbc_connect, I get an error reading "SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect." What if the new version of the driver doesn't support the actions of the old version from the tutorial (http://kb.mediatemple.net
For additional info on this, check out these two solutions:
http://www.experts-exchang
http://www.experts-exchang
Business Accounts
Answer for Membership
by: gheistPosted on 2008-05-10 at 13:21:13ID: 21540386
http://www.freetds.org/use rguide/pre podbc.htm
Its unixODBC misconfiguration - you did not set up datasource at all. Installing/uninstalling drivers is of no help (same on windows)