I'm using latest Php4Delphi Delphi 2005 install with php 5.12
When I get that error message in the subject line I trace it to line 1111 in zenapi.pas which reads:
if @_zval_dtor = nil then raise EPHP4DelphiException.Create('_zval_dtor');
(To get error messages I have commented out QUIET_LOAD so that it takes place)
And this is what I am doing regarding loading the php5ts.dll (I have confirmed that it is loading ok)
I place an ini file in my project directory to point to the PHP I am using, so that I can have a development runtime that does not interfere with my loacal apache server php which is Php4xxx and is in my path. The I can have the php5ts.dll in catered for in my deployment with a sub directory php.
In zenapi.pas I have rewritten the function like this:
function LoadZEND(const DllFilename: string) : boolean;
var
WriteFuncPtr : pointer;
whereIsPhp, hereIsPhP : string;
whereIsPhpIni : tinifile;
begin
whereIsPhp := extractfilepath(paramstr(0))+'whereIsPhp.ini';
if fileexists(whereIsPhp) then
begin
whereIsPhpIni := tinifile.Create(whereIsPhp);
{ lets me have a development path for Php and extensions, and a deployment path default
whereIsPhp.ini should be in the application exe directory if I want to nominate a
path other than application.exe sub dir /php/ as the location of the phpNNN.dll and php.ini
}
try
hereIsPhP := whereIsPhpIni.ReadString('Files','whereIsPhp',extractfilepath(paramstr(0)) +'php\');
finally
whereIsPhpIni.Free;
end;
end
else
hereIsPhP := extractfilepath(paramstr(0)) +'php\'; // [app.exe]\php\ is my default path
Result := false;
PHPLib := LoadLibrary(PChar(hereIsPhp ));
{$IFNDEF QUIET_LOAD}
if PHPLib = 0 then raise Exception.CreateFmt('%s not found', [DllFileName]);
{$ELSE}
if PHPLib = 0 then Exit;
{$ENDIF}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've done everything again just plain with the php5 and php5/ext in my path, I've stopped zenapi.pas using my custom .ini, And I've tried using the DLLfolder and INIpath properties in TpsvCustomPHP although I can find no reference to them in the help file.
Still I get unable to link to _zval_dtor under Delphi 2005.
Any one got any ideas please?
Paul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using latest Php4Delphi Delphi 2005 install with php 5.12
When I get that error message in the subject line I trace it to line 1111 in zenapi.pas which reads:
if @_zval_dtor = nil then raise EPHP4DelphiException.Create('_zval_dtor');
This is my php.inc top portion does it look ok?
{.$DEFINE PHP4}
{.$DEFINE PHP433}
{.$DEFINE PHP430}
{If you are using PHP 4 please comment $DEFINE PHP5}
{PHP5 must be defined if you are using PHP5}
{$DEFINE PHP5}
{For PHP5 you have to define subversion}
{.$DEFINE PHP504}
{.$DEFINE PHP510}
{.$DEFINE PHP511}
{$DEFINE PHP512}
{.$IFDEF PHP433}
{.$DEFINE PHP4}
{.$UNDEF PHP5}
{.$UNDEF PHP504}
{.$UNDEF PHP510}
{.$UNDEF PHP511}
{.$UNDEF PHP512}
{.$ENDIF}
{.$IFDEF PHP430}
{.$DEFINE PHP4}
{.$UNDEF PHP5}
{.$UNDEF PHP504}
{.$UNDEF PHP510}
{.$UNDEF PHP511}
{.$UNDEF PHP512}
{.$ENDIF}
{$IFDEF PHP5}
{$UNDEF PHP4}
{$UNDEF PHP430}
{$UNDEF PHP433}
{$ENDIF}
(To get error messages I have commented out QUIET_LOAD so that it takes place)
And this is what I am doing regarding loading the php5ts.dll (I have confirmed that it is loading ok)
I place an ini file in my project directory to point to the PHP I am using, so that I can have a development runtime that does not interfere with my loacal apache server php which is Php4xxx and is in my path. The I can have the php5ts.dll in catered for in my deployment with a sub directory php.
In zenapi.pas I have rewritten the function like this:
function LoadZEND(const DllFilename: string) : boolean;
var
WriteFuncPtr : pointer;
whereIsPhp, hereIsPhP : string;
whereIsPhpIni : tinifile;
begin
whereIsPhp := extractfilepath(paramstr(0))+'whereIsPhp.ini';
if fileexists(whereIsPhp) then
begin
whereIsPhpIni := tinifile.Create(whereIsPhp);
{ lets me have a development path for Php and extensions, and a deployment path default
whereIsPhp.ini should be in the application exe directory if I want to nominate a
path other than application.exe sub dir /php/ as the location of the phpNNN.dll and php.ini
}
try
hereIsPhP := whereIsPhpIni.ReadString('Files','whereIsPhp',extractfilepath(paramstr(0)) +'php\');
finally
whereIsPhpIni.Free;
end;
end
else
hereIsPhP := extractfilepath(paramstr(0)) +'php\'; // [app.exe]\php\ is my default path
hereIsPhp:= IncludeTrailingPathDelimiter(hereIsPhp)+DllFileName;
showmessage(hereIsPhp);
Result := false;
PHPLib := LoadLibrary(PChar(hereIsPhp ));
{$IFNDEF QUIET_LOAD}
if PHPLib = 0 then raise Exception.CreateFmt('%s not found', [DllFileName]);
{$ELSE}
if PHPLib = 0 then Exit;
{$ENDIF}
I've done everything again just plain with the php5 and php5/ext in my path, I've stopped zenapi.pas using my custom .ini, And I've tried using the DLLfolder and INIpath properties in TpsvCustomPHP although I can find no reference to them in the help file.
Still I get unable to link to _zval_dtor under Delphi 2005.
Any one got any ideas please?
Paul