chrisemunt / mg_php

A PHP Extension for InterSystems Cache/IRIS and YottaDB.
Apache License 2.0
13 stars 0 forks source link

Unworking with YottaDB 2.01 and PHP 8.3.6 #2

Open sukamenev opened 6 days ago

sukamenev commented 6 days ago
#!/usr/bin/env php
<?php

error_reporting(E_ALL & ~E_NOTICE);
print(m_ext_version()."\n");

$envvars = "";
$envvars .= "ydb_dir=/home/btest/.yottadb\n";
$envvars .= "ydb_rel=r2.01_x86_64\n";
$envvars .= "ydb_gbldir=/home/btest/.yottadb/r2.01_x86_64/g/yottadb.gld\n";
$envvars .= "ydb_routines=/home/btest/.yottadb/r2.01_x86_64/o/utf8*(/home/btest/.yottadb/r2.01_x86_64/r /home/btest/.yottadb/r) /opt/yottadb/r2.01/plugin/o/utf8/_ydbaim.so /opt/yottadb/r2.01/plugin/o/utf8/_ydbocto.so /opt/yottadb/r2.01/plugin/o/utf8/_ydbposix.so /opt/yottadb/r2.01/utf8/libyottadbutil.so\n";
$envvars .= "ydb_ci=/opt/yottadb/r2.01/zmgsi.ci\n";
$envvars .= "\n";

m_set_error_mode(0);

$r = m_bind_server_api("YottaDB", "/opt/yottadb/r2.01", "", "", $envvars, "");
var_dump($r);

die();

This code show me:

MGateway Ltd. - mg_php: PHP Gateway to M - Version 3.3.62
string(0) ""

No visible errors. I don't understand what is a problem.

ydb, yottadb - working perfect.

If I add after:

$result = m_set("^Person", 1, "Chris Munt");
var_dump($result);

$result = m_get("^Person", 1);
var_dump($result);

$r = m_release_server_api();
var_dump($r);

I got error:

%YDB-F-KILLBYSIGSINFO1, YottaDB process 19456 has been killed by a signal 11 at address 0x00007F47FB436BF4 (vaddr 0xFFFFFFFF000000D9)
%YDB-F-SIGMAPERR, Signal was caused by an address not mapped to an object

If I run php as apache module (mpm prefork):

MGateway Ltd. - mg_php: PHP Gateway to M - Version 3.3.62<br />
<b>Fatal error</b>:  The server API is not available on this host
sukamenev commented 6 days ago

In PHP 8.2.25 in cli mode mg_php also don't working. And show strange info.

MGateway Ltd. - mg_php: PHP Gateway to M - Version 3.3.62
string(0) ""
string(58) "OCAL#USER#0#0#0#1.5.23#0^S^0000P
7^Person1110Chris Munt"
string(45) "OCAL#USER#0#0#0#1.5.23#0^G^0000C
7^Person11"
string(0) ""
sukamenev commented 6 days ago

Even if we assume that I am doing something wrong, then it is obvious that some error is happening, but the mg_php does not report anything about it.