piersharding / php-sapnwrfc

SAP RFC Connector using the SAP NW RFC SDK for PHP
http://www.piersharding.com/blog/
51 stars 15 forks source link

Windows build: my current result #6

Closed ThaDafinser closed 9 years ago

ThaDafinser commented 10 years ago

I'm currently trying to build this as a windows extension.

My dev enviroment on the php side should be fine ... already compiled some other php-extensions. But it seems i have at least one error left with this extension.

My progress so far:

building as dll with VS2012

I "sucessfully" created the dll with VS2012 for TS and NTS. (the build log says that...) https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-log_nts-txt https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-log_ts-txt

But when loading this extension with php it complains: PHP Startup: Invalid library (maybe not a PHP library) 'php_sapnwrfc.dll' in Unknown on line 0

building with config.w32 (counter file of config.m4)

So i tried another approach: Building a config.w32 file. https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-config-w32 Note: i moved the SAP NW RFC files inside the extension folder nwrfcsdk/[lib]|[include] The files are already checked in the config.w32 files and when extecutiong configure --options.... all seems to be fine https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-configure-log

command nmake doesnt complain...

when executing nmake snap it complains:

WARNING: distro depends on msvcr110.dll, but could not find it on your system
WARNING: distro depends on sapnwrfc.dll, but could not find it on your system

https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-gistfile1-txt

When i run sample.php i already come to this output(without dl function at begin):

sapnwrfc version: 0.11
nw rfc sdk version: major: 7200 minor: 0 patch: 22

Then at the line $conn = new sapnwrfc($config); is breaks:

Run-Time Check Failure #2 - Stack around the variable 'errorInfo' was corrupted

Notes / Questions

ThaDafinser commented 10 years ago

//UPDATE after adding the two missing dll files to C:\php-sdk\phpdev\vc11\x86\deps\bin there are no build errors/warnings anymore.....

But still the same error

Run-Time Check Failure #2 - Stack around the variable 'errorInfo' was corrupted

Some incompability with my SAP NW RFC SDK?

piersharding commented 10 years ago

I'm wondering if you are linking against 64bit libraries on a 32bit stack?

ThaDafinser commented 10 years ago

@piersharding hmm i hope not...was also my first idea....but that will be hopefully the failure....otherwise i don't know where to look :cry:

My enviroment:

I also would have those packages if needed:

ThaDafinser commented 10 years ago

Some note for SAP NW RFC SDK 7.20

I extracted it with sapcar -xvf [FILENAME] and received all lib and include files... Which i used then directly (.h and .dll files)

I've also a PDF, where some commands are in to compile, but i don't know if i need them after extracting? (Also saw those in you config.m4 build file)

Windows (x86, 32 Bit)
cl -DBCDASM -nologo -Od -Ob1 -fp:strict -Gy -GF -EHs -Z7 -W3 -Wp64 -D_X86_ -
DWIN32 -DSAPwithUNICODE -DUNICODE -D_UNICODE -MD -D_AFXDLL -FR -J -RTC1 -
D_CRT_NON_CONFORMING_SWPRINTFS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSAPonNT -
c /EHc- /TP <Programm>.cpp

link -nologo /NXCOMPAT -STACK:0x800000 ole32.lib rpcrt4.lib oleaut32.lib
oledb.lib uuid.lib kernel32.lib advapi32.lib user32.lib gdi32.lib winspool.lib ws2_32.lib
Iphlpapi.lib netapi32.lib comdlg32.lib shell32.lib dbghelp.lib version.lib mpr.lib secur32.lib -
OPT:REF -LARGEADDRESSAWARE -subsystem:console -out:<Programm>.exe <Programm>.obj sapnwrfc.lib
libsapucum.lib [und eventuell sapdecfICUlib.lib]
piersharding commented 10 years ago

Hi -

you have tried using "SAP NW RFC SDK 7.20 - Windows on x64 64bit" ?

Cheers.

ThaDafinser commented 10 years ago

@piersharding yes tried it now...get than the errors listed below.

Hower there must be a miscompability...sapnwrfc_version() and sapnwrfc_rfcversion work. Also the phpinfo tells me the module is loaded...

What kind of version do u use?

C:\php-sdk\phpdev\vc11\x86\php5.5-201405060630>nmake

Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation.  All rights reserved.

Recreating build dirs
Recreating build dirs
   Creating library Release\php5.lib and object Release\php5.exp
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetVersion@12 refer
enced in function _sapnwrfc_object_clone
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetIniPath@8 refere
nced in function _sapnwrfc_object_clone
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcReloadIniFile@4 ref
erenced in function _sapnwrfc_object_clone
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcUTF8ToSAPUC@24 refe
renced in function _u8to16c
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSAPUCToUTF8@24 refe
renced in function _u16to8c
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetTypeAsString@4 r
eferenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetDirectionAsStrin
g@4 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcOpenConnection@12 r
eferenced in function _sapnwrfc_open
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcCloseConnection@8 r
eferenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcPing@8 referenced i
n function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetConnectionAttrib
utes@12 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetPartnerSSOTicket
@16 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcInvoke@12 reference
d in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcCreateFunction@8 re
ferenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcDestroyFunction@8 r
eferenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetParameterActive@
16 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcIsParameterActive@1
6 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetCurrentRow@8 ref
erenced in function _get_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcAppendNewRow@8 refe
renced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcMoveTo@12 reference
d in function _get_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetRowCount@12 refe
renced in function _get_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetChars@20 referen
ced in function _get_char_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetNum@20 reference
d in function _get_num_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetDate@16 referenc
ed in function _get_date_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetTime@16 referenc
ed in function _get_time_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetString@24 refere
nced in function _get_string_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetBytes@20 referen
ced in function _get_byte_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetXString@24 refer
enced in function _get_xstring_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetInt@16 reference
d in function _get_int_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetInt1@16 referenc
ed in function _get_int1_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetInt2@16 referenc
ed in function _get_int2_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetFloat@16 referen
ced in function _get_float_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetStructure@16 ref
erenced in function _get_structure_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetTable@16 referen
ced in function _get_field_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetStringLength@16
referenced in function _get_string_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetChars@20 referen
ced in function _set_char_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetNum@20 reference
d in function _set_num_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetString@20 refere
nced in function _set_bcd_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetDate@16 referenc
ed in function _set_date_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetTime@16 referenc
ed in function _set_time_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetBytes@20 referen
ced in function _set_byte_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetXString@20 refer
enced in function _set_xstring_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetInt@16 reference
d in function _set_int_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetInt1@16 referenc
ed in function _set_int1_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetInt2@16 referenc
ed in function _set_int2_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcSetFloat@20 referen
ced in function _set_float_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcDescribeType@8 refe
renced in function _get_structure_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetFunctionDesc@12
referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcRemoveFunctionDesc@
12 referenced in function _sapnwrfc_object_clone
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetFieldCount@12 re
ferenced in function _get_structure_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetFieldDescByIndex
@16 referenced in function _get_structure_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetFieldDescByName@
16 referenced in function _set_structure_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetParameterCount@1
2 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetParameterDescByI
ndex@16 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcGetParameterDescByN
ame@16 referenced in function _set_table_value
sapnwrfc.obj : error LNK2019: unresolved external symbol _RfcDestroyFunctionDesc
@8 referenced in function _sapnwrfc_function_object_free_storage
Release\php5.dll : fatal error LNK1120: 56 unresolved externals
NMAKE : fatal error U1077: '"C:\Data\Microsoft Visual Studio 11.0\VC\BIN\cl.exe"
' : return code '0x2'
Stop
ThaDafinser commented 10 years ago

Loaded librarys when crashing: https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-report_crash-txt

piersharding commented 10 years ago

HI -

If I understand correctly, what information you have listed before, your windows platform is 64bit, which means that you should use the 64bit NW RFC SDK.

From the errors above, I think it is showing that you are not linking in the SDK libraries - this is what the unresolved symbols seem to indicate.

After compile, the linker should be at least including libsapnwrfc.so, and librfcum.so (the equivalent DLLs)- and maybe libsapu16, libicudata, libicudecnumber, libicu18n, libicuuc .. The crash log does not show any of these being loaded, so I don't think they have been linked to?

ThaDafinser commented 9 years ago

I started off fresh with following steps: 1) Follow the dev setup https://wiki.php.net/internals/windows/stepbystepbuild 2) Copy from nwrfcsdk (7200.613.22.50635) the include + lib to C:\php-sdk\phpdev\vc11\x86\deps[include|lib] (32bit)...since PHP is build x86 3) copy msvcr110.dll to C:\php-sdk\phpdev\vc11\x86\deps\lib (was missing and is needed for php.exe as well) 3) use this custom created config.w32

// $Id$
// vim:ft=javascript

ARG_WITH("sapnwrfc", "*****SAP NW RFC*****", "no");
if (PHP_SAPNWRFC != "no") {

    //checking for header
    sap_nw_rfc_header = CHECK_HEADER_ADD_INCLUDE("sapnwrfc.h", "CFLAGS_SAPNWRFC");
    if (sap_nw_rfc_header) {
    } else{
        WARNING("sapnwrfc not enabled; header sapnwrfc.h not found");
    }

    //checking for library
    sap_nw_rfc_lib = CHECK_LIB("sapnwrfc.lib", "sapnwrfc", PHP_SAPNWRFC);
    if (sap_nw_rfc_header && sap_nw_rfc_lib) {
        EXTENSION("sapnwrfc", "sapnwrfc.c");
    } else{
        WARNING("sapnwrfc not enabled; lib sapnwrfc.lib not found");
    }
}

4) Execute

configure --disable-all --enable-cli --with-sapnwrfc=shared --disable-zts

5) include the php_sapnwrfc.dll 6) phpInfo shows (only table header)

sapnwrfc
sapnwrfc support    enabled

7) When using a saprfc function this error comes up: saprfc extension is not installed. Please install/configure it: http://sourceforge.net/projects/saprfcsdk/

8) Since the log doesnt give me anything useful, maybe you got a last idea? -> See log: https://gist.github.com/ThaDafinser/ca3d237a17a71bfa4c8a

If we get this finally running, i would also like to get this on pecl.php.net that the builds for windows are done automatically, if you are fine with it @piersharding

//cc @weltling

piersharding commented 9 years ago

Hi - I'm not sure why you are referring to saprfc (by Eduard) as that is a different implementation to sapnwrfc. I'm fairly sure that you will have problems trying to get x86 working as the SAP NW RFC SDK is 64bit only? So first of all make sure that you are not using saprfc (remove all traces of it from your build and php config), and make sure that you are using the MS Visual C++ compiler.
I do not have a Windows development environment so I can't build this for you. From time to time someone from the mailing lists will do one for me and I make it available for download.

Also, if the extension compiles OK, then it still may have trouble loading if it cannot resolve all of the DLL dependencies, so try inspecting the sapnwrfc.dll with a dependency walker - in the past I have heard that these kinds of problems have been resolved by copying the dependent DLLs into the system32 directory.

Cheers, Piers Harding.

weltling commented 9 years ago

@ThaDafinser for your previous error logs - you was linking x86 PHP to a x64 SAP library. That won't work, probably was the reason for those "undefined symbol" errors. It doesn't really matter what the platform is, but merely that you link correct libs together. Be sure you're on the right env, you can check it with like "cl /?".

Another point - one shouldn't copy the CRT DLL, instead it's enough to install a VS2012 redistributable on the target machine (with VS it's present automatically). So merely what is needed for the php_*.dll is the CRT, the PHP DLL, if it's linked against some dependency DLL -that too, on the path. For production, you can copy sapnwrfc.dll into PHP dir, otherwise just prepend %path% with the correct location.

With PECL - while the sapnwrfc ext itself is under PHP how it looks, there might be a legal issue with linking against (and/or redistributing) the dependency binaries. For instance, i was about to give it a quick try, but wasn't able to obtain the dependency SDK.

chemik3 commented 9 years ago

Hi, you can download compiled php module for saprfc and sapnwrfc projects here: https://sourceforge.net/projects/saprfcsapnwrfc/files/?source=navbar

piersharding commented 9 years ago

Hi - Thanks for providing the compiled binaries. I'll point to this in the README. Cheers, Piers Harding.

ThaDafinser commented 9 years ago

@chemik3 AWESOME! But it's only for the x64 build and not for the x86? http://sourceforge.net/projects/saprfcsapnwrfc/

Could you maybe tell us (or me) how u build it? And then we can maybe create a config.w32 file here in this repo

chemik3 commented 9 years ago

I like to compile for x86 architecture but i can't find SAP NW RFC SDK or SAP RFC SDK for x86(windows) on SAP Marketplace. If you have that version of SDK can you send me?

ThaDafinser commented 9 years ago

@chemik3 i think i have the correct ones, where can i send you the files?

ThaDafinser commented 9 years ago

@chemik3 maybe you also want to share the build configuration, that we maybe can provide the config.w32 file`?

chemik3 commented 9 years ago

I was used following preprocessor directives:

WIN32 _WINDOWS _USRDLL SAPNWRFC_EXPORTS ZEND_WIN32 PHP_WIN32 ZTS=1 ZEND_DEBUG=0 COMPILE_DL_SAPNWRFC _UNICODE UNICODE SAPwithUNICODE

ThaDafinser commented 9 years ago

Thank you @chemik3 for the directives!

inceddy commented 9 years ago

Did you make any progress regarding the SAPRFC extension? I have no clue about compiling PHP and C/C++. But this is what I tryed:

config.w32

// $Id$
// vim:ft=javascript

ARG_WITH("saprfc", "Support of SAPRFC", "no");

if (PHP_SAPRFC != "no") {
    EXTENSION("saprfc", "saprfc.c rfccal.c", false);
    ADD_SOURCES("ext/saprfc/rfcsdk/include", "sapirfci.c");

    ADD_FLAG("CFLAGS_SAPRFC","/D WIN32 /D SAPRFC_EXPORTS /D COMPILE_DL_SAPRFC /D ZEND_DEBUG=0 /D NDEBUG /D _WINDOWS /D _USRDLL /D ZEND_WIN32 /D PHP_WIN32 /D _USE_32BIT_TIME_T /D ZTS=1");

    PHP_INSTALL_HEADERS("ext/saprfc", "php_saprfc.h rfccal.h");
    PHP_INSTALL_HEADERS("ext/saprfc/rfcsdk/include", "rfcpump.h rfcsi.h sapconn.h sapirfc.h sapitab.h sapmtx.h sapobj.h saprfc.h sapuc.h sapucx.h srfcserv.h srfctest.h trfcserv.h trfctest.h")

}

I'm using the rfcsdk 6.20 located in the extension folder. Also I changed the saprfc.h due to errors I got. All RETURN_RESOURCE(zend_list_insert(rfc_resource, le_rfc)); need an TSRMLS_CC after the second argument and function_entry becomes zend_function_entry.

Now I get linker errors I can not solve.

Microsoft (R) Program Maintenance Utility, Version 11.00.50727.1
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

Recreating build dirs
sapirfci.c
   Bibliothek "Release_TS\php5ts.lib" und Objekt "Release_TS\php5ts.exp" werden
erstellt.
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcL
astError@4" in Funktion "___cal_last_error".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcO
penEx@8" in Funktion "__cal_open".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcI
nstallStructure@16" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
allReceive@24" in Funktion "___cal_fce_call".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcI
ndirectCallEx@20" in Funktion "___cal_fce_indirect_call".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcG
etData@12" in Funktion "___sal_get_data".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcS
endData@12" in Funktion "___sal_send_data".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcR
aise@8" in Funktion "___sal_raise".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcR
aiseTables@12" in Funktion "___sal_raise".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
onfirmTransID@8" in Funktion "___cal_fce_indirect_call".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcG
etAllLibVersions@8" in Funktion "___cal_lib_version".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
onvertCharToBcd@20" in Funktion "_cal_conv_string_to_rfc".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
onvertBcdToChar@20" in Funktion "_cal_conv_rfc_to_string".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItCr
eate@16" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItDe
lete@4" in Funktion "___cal_del_fce".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItGe
tLine@8" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItPu
tLine@12" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItIn
sLine@8" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItAp
pLine@4" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItDe
lLine@8" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItFr
ee@4" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItFi
ll@4" in Funktion "___cal_table".
rfccal.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_ItLe
ng@4" in Funktion "___cal_table".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcA
ccept@4" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcA
cceptExt@4" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
lose@4" in Funktion "__free_resource_rfc".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcA
bort@8" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcS
etCodePage@8" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcG
etAttributes@8" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
heckRegisterServer@32" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
ancelRegisterServer@24" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcG
etNameEx@8" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcW
aitForRequest@8" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcI
nstallFunction@12" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcI
nstallTransactionControl@16" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcC
reateTransID@8" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcA
llowStartProgram@4" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcS
etTrace@8" in Funktion "__zval_copy_ctor".
saprfc.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_RfcG
etTicket@8" in Funktion "__zval_copy_ctor".
Release_TS\php5ts.dll : fatal error LNK1120: 39 nicht aufgelöste Externe
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\cl.exe"": Rückgabe-Code "0x2"
Stop.

Any ideas about that?

chemik3 commented 9 years ago

inceddy: The easiest way to get precompiled binaries is download it here:

https://sourceforge.net/projects/saprfcsapnwrfc/files/?source=navbar

inceddy commented 9 years ago

The problem is, thar I need this extension for at least 3 different PHP versions and in 32bit :/ How did you make this run?! ;)

inceddy commented 9 years ago

5.6.3, 5.5.11, 5.4.19 all in x86 architecture.

chemik3 commented 9 years ago

I tested now that version bellow supported also PHP 5.6.3

https://sourceforge.net/projects/saprfcsapnwrfc/files/?source=navbar

i will try to compile also for previous version of PHP.

inceddy commented 9 years ago

Not for me due to x64 architecture.

chemik3 commented 9 years ago

It is supporting both x86 and x64 architecture:

image

inceddy commented 9 years ago

Maybe I'm in the wrong thread. I'm looking for SAPRFC not SAPNWRFC (btw. I don't know the difference). Got here from a comment on http://stackoverflow.com/questions/28170742/how-to-install-saprfc-with-php-5-4-4-in-windows-32-system

chemik3 commented 9 years ago

SAPRFC ans SAPNWRFC are different projects. I like to compile SAPRFC binaries for x86 but sap probably not supported x86 on windows and I can't download SAP RFC SDK for this architecture: image

If you have x86 version of SDK send me and i will try compile php extension.

inceddy commented 9 years ago

I could send you the sdk version 6.2 x86.

ThaDafinser commented 9 years ago

@inceddy sorry for the comment on stackoverflow...yes sapnwrfc != saprfc

I create a guide here how i finally could compile it with Visual Studio, maybe that helps? https://github.com/piersharding/php-sapnwrfc/tree/master/builds

I failed while creating the config.w32 file, but i see you made there some progress with the flags :+1:

@chemik3 will be the right guy here to help, since he seems to know what he does here and does not try + error like me xD

inceddy commented 9 years ago

Somewhere I read, that one can use the Windows Server on IA32 32bit SDK for compiling on windows x86. Maybe you could give this a try.

This was mentioned on http://sourceforge.net/p/saprfcsdk/wiki/SAPRfcSdk%20-%20Axel%20Arnold%20Bangert%20-%20Herzogenrath%202013/

You have to use the IA x32 Version for example (SAP RFC SDK 7.20 for Windows Server on IA32 32bit) librfc32.dll for Win32 from RFCSDK (it is part of SAPGUI for Windows too, which is under the License of SAP)

chemik3 commented 9 years ago

I compiled SAPRFC for x86 for PHP 5.6, you can download here:

https://sourceforge.net/projects/saprfcsapnwrfc/files/saprfc-1.4.1.zip/download

check if that works.

inceddy commented 9 years ago

Awsome! It works! It would be nice if you could share the information how you made this work ;) Than I would give a try to compile it for 5.4 and 5.5 myself.

How ever @chemik3 thank you very much!

chemik3 commented 9 years ago

I was compiled saprfc also for PHP 5.5/x86 and updated files here:

https://sourceforge.net/projects/saprfcsapnwrfc/files/?source=navbar

waldmeisterx commented 9 years ago

I'm looking for a SAPRFC x86 for PHP 5.6 but NTS version. The versions given above are all TS (threadsafe).

@chemik3 could you compile such a version as well? (I think, remove the prepocessor parameter ZTS=1 will do it?)

chemik3 commented 9 years ago

waldmeisterx: Try following file and let me know if works:

http://monka.hysteria.cz/~chemik/sap/php_saprfc_PHP5.6_x86_nts.dll

waldmeisterx commented 9 years ago

@chemik3: Thank a lot for the quick response! :) First quick test ist positive! PHP loads the extension without error and it shows up in phpinfo(). Quick funcional check ist positive too, but let me do some more functional checks today.

ThaDafinser commented 9 years ago

@chemik3 @waldmeisterx there are also some here: https://github.com/piersharding/php-sapnwrfc/tree/master/builds

waldmeisterx commented 9 years ago

@ThaDafinser yes, but these are sapnwrfc an these differ from (old) saprfc!

waldmeisterx commented 9 years ago

@chemik3: Now I have finished some more and detailed tests. It works like a charm. :) Thank you very much for the very fast support! Now I can prepare the PHP upgrade, for which I need the new dll.

jazzhh commented 8 years ago

Hi, is there anybody who is able to create a sapnwrfc.dll für PHP Version 5.2.14 x86? Thans in advance :)

ThaDafinser commented 8 years ago

@jazzhh 5.2 is not supported anymore. Please upgrade

jazzhh commented 8 years ago

@ThaDafinser OK, which version do you recommend?

ThaDafinser commented 8 years ago

@jazzhh of course PHP7 if you can upgrade already Otherwise you should upgrade to PHP 5.5 at least (which have at least security support until 31 Dec 2018)

http://php.net/supported-versions.php http://php.net/eol.php

jazzhh commented 8 years ago

@ThaDafinser Allright, thank you!