note 32678 added to function.mssql-connect
| From: | aissam at yahoo dot com | Date: | Wed, 04 Jun 2003 10:38:33 +0000 |
| Subject: | note 32678 added to function.mssql-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49703@lists.php.net to get a copy of this message | ||
You don't need to reconfigure/reinstall all php.
you could use phpize 'n libtool.
i've MDK 9.1, and already installed freetds
i installed php-devel package with contains php extensions (/usr/src/php-devel/ext)
here's the full step, of what i've done
#cd /usr/src/php-devel/ext/mssql
#phpize
this create configure file
#./configure --with-mssql=/usr/path/to/freetds
#make
if you make install we'll get
/usr/lib/php/extensions/mssql.so: undefined symbol: dbinit
when u'll try to restart apache (i'm using mod_php)
you need to run
#./libtool --mode=link gcc -L/usr/path/to/freetdsl/lib -lsybdb -I. -I/usr/src/php-devel -DEAPI -g
-02 -o php_mssql.la -avoid-version -module -rpath /usr/src/php-devel/ext/mssql/modules
php_mssql.lo
this command create the php_mssql.so on .libs directory,
congratulation ;) all u need now is to copy the php_mssql.so to php extension dir (see php.ini)
#grep extension_dir /etc/php.ini
extension_dir = /usr/lib/php/extensions
#cp .libs/php_mssql.so /usr/lib/php/extensions/mssql.so
edit now php.ini and add (on dynamic extension section)
extension=php_mssql.so
and restart apache
#apachectl restart
don't forget to add the server on freetds.conf
an eg.
[MYSQLSERVER]
host=sqlserver.mydomain.dot.not.net
port=1433
tds version = 7.0
all u need now is to test this ;)
<?
$conn=mssql_connect("eql","sa",'p0gn0n=$');
if ($conn) {
echo "Yeah i'm the best ;)";
}
else {
echo "Woops ! ".mssql_get_last_message();
}
?>
Have fun all ;)
----
Manual Page -- http://www.php.net/manual/en/function.mssql-connect.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32678
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32678&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32678&report=yes