I have problem running a php script on Ubuntu 8.04 Server, but it works on Ubuntu 9.10 Desktop
On Ubuntu 8.04 the php call: mssql_execute returns Segementation Fault. I have debugged it using gdb and noticed that it is the call to dbrpcexec that fails: (please not that this is defined to dbrpcsend in a include.h file)
I use the the same odbc and freetds konfiguration:
odbc.init:
Code: Select all
[MSSQLdatabase]
Description = Octus Database
Driver = FreeTDS
Trace = No
Servername = SQLServer #refers to the SQLServer in /etc/freetds.conf
Port = 1433
Database = mdb_staging
Code: Select all
text size = 64512 (also tested with 564512)
[SQLServer]
host = XXX.XXX.XXX.XXX
port = 1433
tds version = 8.0
client charset = UTF-8
Code: Select all
// Connect to MSSQL and select the database
$link=mssql_connect("SQLServer", "user", "password");
if (!$link) {
die('Something went wrong while connecting to MSSQL');
}
mssql_select_db('mdb_staging');
$startExport= mssql_init("StartNewExport");
$res = mssql_query( "delete ci_asset_lms", $link) or die("Could not delete");
mssql_free_result($res);
// the mssql_free call fails with error:
//Warning: mssql_free_result(): supplied argument is not a valid MS SQL-result resource in /home/gui-server/from_melloman/sync_lms_to_amigo.php on line 536
// On both servers
//Define Parameters
$sp_sparram->param1= 'ci_asset_lms';
$sp_sparram->parm2 = 'system_lms';
$sp_sparram->parm3 = '';
//Load Parameters
mssql_bind($startExport, '@import_type', $sp_sparram->param1, SQLTEXT, false);
//mssql_bind($startExport, '@creator', $sp_sparram->parm2, SQLTEXT, false);
//mssql_bind($startExport, '@import_id', $sp_sparram->parm3, SQLINT4, true);
mssql_execute($startExport);
Any suggestions?