• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

FreeTDS with Plesk8

T

taftech

Guest
I had FreeTds (for connecting to mssql databases) working with plesk7. I Installed it, recompiled php to work with it, and it worked. Pretty simple.

However, now I have Plesk 8 and PHP was upgraded to 5, It doesn't seem so simple. I have Installed FreeTDS and downloaded/compiled php5 to work with it. However, the old version of php5 is still being used. PHP doesn't seem to be loaded by apache as a module anymore. How can I load the new php5?

Thank You
 
Did you have any luck? I'm also looking for a quick and easy way to connect to a Microsoft SQL Server 200x data source using Plesk 8 for Linux.
 
Ive built the php-mssql module in my PHP 5.2.5 rpms. I've successfully used it against mssql and sybase servers. I don't recall having to do anything special to get it to work. The freetds dependencies are also available in the archive. To set it up run:

wget -q -O - http://www.atomicorp.com/installers/atomic |sh

and then install the mssql module:
yum install php-mssql
 
Hello atomicturtle,

I am trying to install FreeTDS on my Linux REL (Plesk 8.3) to get php to connect to remote MSSQL server 5.

Can you please help me?

My system details:
Linux 2.6.18-53.1.13.el5 x86_64

I have run the command you gave above but

after I ran the yum install php-mssql, it seems to go fine but then I check the phpinfo page and no mssql support is displayed..

What am I missing??

Thanks
 
Thank you atomicturtle,

stupid me, I hadn't restarted the httpd service...

After I did it, I checked the phpinfo page and mssql support showed up.

Now I just need to test the connection to thee microsoft sql server 5, I'm not sure how because it is the first time I configure freetds.
 
atomicturtle,

Hi,
Thank you very much for your reply.

I have managed to get the db connection test to work using tsql command, using the dsn from /etc/freetds.conf.
However when I try to access it using a php script, it yells an error related to module php_ioncube_loader_lin_5.1_x86_64.so

Here are the details of my freetds settings, the php script I try to run and the error. I am researching for the cause of that error but haven't been able to find anything yet.

Is the below configuration of tds coming from your repo?

================================================
# rpm -qa | grep tds
docbook-dtds-1.0-30.1
xhtml1-dtds-1.0-7.1.1
freetds-0.64-1.el5.art
================================================
# tsql -C
Compile-time settings (established with the "configure" script):
Version: freetds v0.64
MS db-lib source compatibility: yes
Sybase binary compatibility: unknown
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes

================================================
The php script I am running to test
# more /var/www/vhosts/mydomain.com/httpdocs/dbsetsu.php
<?php
$user="sa";
$dsn="DBTEST";
$password="mypassword";
$dbh = odbc_connect($dsn, $user, $password);

$result = odbc_tables($dbh);

$tables = array();
while (odbc_fetch_row($result)){
if (odbc_result($result,"TABLE_TYPE")=="TABLE")
echo"
".odbc_result($result,"TABLE_NAME");
}
?>
================================================
And here the error message
# php /var/www/vhosts/mydomain.com/httpdocs/dbsetsu.php
Failed loading /usr/lib64/php/modules//php_ioncube_loader_lin_5.1_x86_64.so: /usr/lib64/php/modules//php_ioncube_loader_lin_5.1_x86_64.so: undefined symbol: zend_unmangle_property_name_ex
PHP Warning: odbc_connect(): SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect in /var/www/vhosts/mydomain.com/httpdocs/dbsetsu.php on line 5
PHP Warning: odbc_tables(): supplied argument is not a valid ODBC-Link resource in /var/www/vhosts/mydomain.com/httpdocs/dbsetsu.php on line 7
PHP Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in /var/www/vhosts/mydomain.com/httpdocs/dbsetsu.php on line 10

================================================

It's it strange, could it be that some php dependencies are failing?

Thank you,
 
Back
Top