Hi,
I am having trouble getting the correct working directory in the C/C++ code of my PHP extension. It should be the same as the PHP working directory, but it is not.
I have tried looking this on the web, but with not much joy. I found a blog which describes my problem:
In linux the C function getcwd()
does as expected. It is the same as the PHP cwd, but on windows it always uses the “C:\Program Files\Apache software Foundation\Apache2.2”,
whereas in my php script the call ‘echo getcwd()
;’ returns “C:\www\html” as expected.
Please may someone point me in the write direction of how to get to the PHP current working directory in a C/C++ PHP extension.
Thanks in advance,
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Hi,
I am having trouble getting the correct working directory in the C/C++
code of my PHP extension. It should be the same as the PHP working
directory, but it is not.
[...]
In linux the C functiongetcwd()
does as expected. It is the same as
the PHP cwd, but on windows it always uses the “C:\Program Files
\Apache software Foundation\Apache2.2”,
whereas in my php script the call ‘echogetcwd()
;’ returns “C:\www
\html” as expected.
when using Apache on Windows you are using mod_mpm which is a threaded
environment. Thus there is one process which might serve multiple
requests in different threads. Each thread needs (from user perspective)
its own working directory, thus our thread isolation library, TSRM,
provides an API for that: VCWD_GETCWD. Please see
TSRM/tsrm_virtual_cwd.h for more related APIs. Mind: In 5.6 this has
been moved to Zend/zend_virtual_cwd.h
johannes
Hi,
I am having trouble getting the correct working directory in the C/C++
code of my PHP extension. It should be the same as the PHP working
directory, but it is not.
[...]
In linux the C functiongetcwd()
does as expected. It is the same as
the PHP cwd, but on windows it always uses the “C:\Program Files
\Apache software Foundation\Apache2.2”,
whereas in my php script the call ‘echogetcwd()
;’ returns “C:\www
\html” as expected.when using Apache on Windows you are using mod_mpm which is a threaded
environment. Thus there is one process which might serve multiple
requests in different threads. Each thread needs (from user perspective)
its own working directory, thus our thread isolation library, TSRM,
provides an API for that: VCWD_GETCWD. Please see
TSRM/tsrm_virtual_cwd.h for more related APIs. Mind: In 5.6 this has
been moved to Zend/zend_virtual_cwd.h
Thanks for your quick response.
When I compile my code I am now getting the following error:
Error 93 error LNK2001: unresolved external symbol "__declspec(dllimport) char * __cdecl virtual_getcwd(char *,unsigned int,void * * *)" (_imp?virtual_getcwd@@YAPADPADIPAPAPAX@Z) C:\Users\ond1\Documents\Visual Studio 2012\Projects\saxon\saxon\SaxonProcessor.obj
insertions in my C Code:
#include “TSRM/tsrm_virtual_cwd.h”
….
char cwd[256];
VCWD_GETCWD(cwd, sizeof(cwd));
...
Any ideas?
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
When I compile my code I am now getting the following error:
Error 93 error LNK2001: unresolved external symbol
"__declspec(dllimport) char * __cdecl virtual_getcwd(char *,unsigned
int,void * * *)" (_imp?virtual_getcwd@@YAPADPADIPAPAPAX@Z) C:\Users
\ond1\Documents\Visual Studio 2012\Projects\saxon\saxon
\SaxonProcessor.objinsertions in my C Code:
The subject talks about C++, now C. If you are using C++: Probably that
header is missing extern "C" declarations? Try
extern "C" {
#include "TSRM/tsrm_virtual_cwd.h"
}
johannes
Just to report to the list that the linkage error has not gone away, even with the extern “C” wrapped around the include.
It seems like I need to add some library dependency? But my experience of Windows and c++ is limited.
When I compile my code I am now getting the following error:
Error 93 error LNK2001: unresolved external symbol
"__declspec(dllimport) char * __cdecl virtual_getcwd(char *,unsigned
int,void * * *)" (_imp?virtual_getcwd@@YAPADPADIPAPAPAX@Z) C:\Users
\ond1\Documents\Visual Studio 2012\Projects\saxon\saxon
\SaxonProcessor.objinsertions in my C Code:
The subject talks about C++, now C. If you are using C++: Probably that
header is missing extern "C" declarations? Tryextern "C" {
#include "TSRM/tsrm_virtual_cwd.h"
}johannes
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Hi O'Neil,
Just to report to the list that the linkage error has not gone away, even
with the extern “C” wrapped around the include. It seems like I need to
add some library dependency? But my experience of Windows and c++ is
limited.On 2 Apr 2014, at 15:42, Johannes Schlüter johannes@schlueters.de
wrote:When I compile my code I am now getting the following error:
Error 93 error LNK2001: unresolved external symbol
"__declspec(dllimport) char * __cdecl virtual_getcwd(char *,unsigned
int,void * * *)" (_imp?virtual_getcwd@@YAPADPADIPAPAPAX@Z) C:\Users
\ond1\Documents\Visual Studio 2012\Projects\saxon\saxon
\SaxonProcessor.objinsertions in my C Code:
The subject talks about C++, now C. If you are using C++: Probably that
header is missing extern "C" declarations? Tryextern "C" { #include "TSRM/tsrm_virtual_cwd.h"
}johannes
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/--
do you have your code somewhere around, or at least could you share a
problem snippet?
Regards
Anatol
Hi,
Please find the php_Saxon.h file attached. I am a beginner to the world of php extensions so you might spot things that I should not be doing. Any way the liens of code that you should focus are:
Line 29 (includes the required header)
Lines between 143 - 160
If you need the full project let me know. I have been using VC11. for the setup of the project I followed various tutorial guides such as:
http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a-php-extension-for-windows/
kind regards,
O'Neil
Hi O'Neil,
Just to report to the list that the linkage error has not gone away, even
with the extern “C” wrapped around the include. It seems like I need to
add some library dependency? But my experience of Windows and c++ is
limited.On 2 Apr 2014, at 15:42, Johannes Schlüter johannes@schlueters.de
wrote:When I compile my code I am now getting the following error:
Error 93 error LNK2001: unresolved external symbol
"__declspec(dllimport) char * __cdecl virtual_getcwd(char *,unsigned
int,void * * *)" (_imp?virtual_getcwd@@YAPADPADIPAPAPAX@Z) C:\Users
\ond1\Documents\Visual Studio 2012\Projects\saxon\saxon
\SaxonProcessor.objinsertions in my C Code:
The subject talks about C++, now C. If you are using C++: Probably that
header is missing extern "C" declarations? Tryextern "C" { #include "TSRM/tsrm_virtual_cwd.h"
}johannes
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/--
do you have your code somewhere around, or at least could you share a
problem snippet?Regards
Anatol
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Hi,
Hi,
Please find the php_Saxon.h file attached. I am a beginner to the world
of php extensions so you might spot things that I should not be doing. Any
way the liens of code that you should focus are:Line 29 (includes the required header)
Lines between 143 - 160
If you need the full project let me know. I have been using VC11. for the
setup of the project I followed various tutorial guides such as:http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a
php-extension-for-windows/
kind regards,
O'Neil
Hi O'Neil,
Just to report to the list that the linkage error has not gone away,
even
with the extern “C” wrapped around the include. It seems like I need
to add some library dependency? But my experience of Windows and c++
is limited.On 2 Apr 2014, at 15:42, Johannes Schlüter johannes@schlueters.de
wrote:When I compile my code I am now getting the following error:
Error 93 error LNK2001: unresolved external symbol
"__declspec(dllimport) char * __cdecl virtual_getcwd(char
*,unsigned
int,void * * *)" (_imp?virtual_getcwd@@YAPADPADIPAPAPAX@Z)
C:\Users\ond1\Documents\Visual Studio 2012\Projects\saxon\saxon
\SaxonProcessor.objinsertions in my C Code:
The subject talks about C++, now C. If you are using C++: Probably
that
header is missing extern "C" declarations? Try
extern "C" { #include "TSRM/tsrm_virtual_cwd.h" }
johannes
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/--
do you have your code somewhere around, or at least could you share a
problem snippet?Regards
Anatol
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Yes, first of all you need to extern "C" all the PHP headers, as they are
all C. The php.h is needed on any platform. Then the header include order
seems odd, please take a look at the following:
http://svn.php.net/viewvc/pecl/xmldiff/trunk/php_xmldiff.h?view=markup
http://svn.php.net/viewvc/pecl/ktaglib/trunk/php_ktaglib.h?view=markup
those are the headers of some C++ extensions. Also it might be interesting
for you to look at their config.w32 .
With the VCWD_GETCWD usage - that's only what you need. It's not necessary
to use GetCurrentDirectory or getcwd, VCWD_GETCWD will do the job and care
about TS/NTS portable way.
Please also take a look at this wiki page
https://wiki.php.net/internals/review_comments with some useful hints,
like that there should be no PHP_FUNCTION definitions in php_myext.h but
rather in the .cpp file.
Regards
Anatol
Thanks very much for your help. I will let you know how it goes
Yes, first of all you need to extern "C" all the PHP headers, as they are
all C. The php.h is needed on any platform. Then the header include order
seems odd, please take a look at the following:http://svn.php.net/viewvc/pecl/xmldiff/trunk/php_xmldiff.h?view=markup
http://svn.php.net/viewvc/pecl/ktaglib/trunk/php_ktaglib.h?view=markupthose are the headers of some C++ extensions. Also it might be interesting
for you to look at their config.w32 .With the VCWD_GETCWD usage - that's only what you need. It's not necessary
to use GetCurrentDirectory or getcwd, VCWD_GETCWD will do the job and care
about TS/NTS portable way.Please also take a look at this wiki page
https://wiki.php.net/internals/review_comments with some useful hints,
like that there should be no PHP_FUNCTION definitions in php_myext.h but
rather in the .cpp file.Regards
Anatol
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Dear all,
After much struggle I am still getting the following error on windows when I build php with our extension that uses VC_GETCWD:
error LNK2001: unresolved external symbol "__declspec(dllimport) char * __cdecl virtual_getcwd(char *,unsigned int,void * * *)" (_imp?virtual_getcwd@@YAPADPADIPAPAPAX@Z) C:\Users\ond1\Documents\Visual Studio 2012\Projects\saxon\saxon\php_saxon.obj saxon
Looking more closely at the linker error it seems that the virtual_getcwd cannot be found where the last argument is void ***.
In TSRM/tsrm_virtual_cwd.h we have the following:
#ifdef VIRTUAL_DIR
#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC)
….
The definition of virtual_getcwd further down in TSRM/tsrm_virtual_cwd.h is as follows. Notice that it uses TSRMLS_DC:
CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC);
I notice the use of the macro TSRMLS_CC. In TSRM.h we have following:
#define TSRMLS_D void ***tsrm_ls
#define TSRMLS_DC , TSRMLS_D
#define TSRMLS_C tsrm_ls
#define TSRMLS_CC , TSRMLS_C
It seems that the right macro is not been used or picked up. Any ideas?
Thanks and kind regards,
O'Neil
Thanks very much for your help. I will let you know how it goes
Yes, first of all you need to extern "C" all the PHP headers, as they are
all C. The php.h is needed on any platform. Then the header include order
seems odd, please take a look at the following:http://svn.php.net/viewvc/pecl/xmldiff/trunk/php_xmldiff.h?view=markup
http://svn.php.net/viewvc/pecl/ktaglib/trunk/php_ktaglib.h?view=markupthose are the headers of some C++ extensions. Also it might be interesting
for you to look at their config.w32 .With the VCWD_GETCWD usage - that's only what you need. It's not necessary
to use GetCurrentDirectory or getcwd, VCWD_GETCWD will do the job and care
about TS/NTS portable way.Please also take a look at this wiki page
https://wiki.php.net/internals/review_comments with some useful hints,
like that there should be no PHP_FUNCTION definitions in php_myext.h but
rather in the .cpp file.Regards
Anatol
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than in Visual studio? I know it can be done in the PHP build process for windows as described in the book “Extending and Embedding PHP” by Sara Golemon which I did try but failed with linking errors, maybe because of the config.w32 file not being setup properly. Under linux I have no issues.
kind regards,
O'Neil
hi,
Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than in Visual studio? I know it can be done in the PHP build process for windows as described in the book “Extending and Embedding PHP” by Sara Golemon which I did try but failed with linking errors, maybe because of the config.w32 file not being setup properly. Under linux I have no issues.
Actually the better and recommended way is not to use VS but for debugging.
See https://wiki.php.net/internals/windows/stepbystepbuild
--
Pierre
@pierrejoye | http://www.libgd.org
hi,
Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than in Visual studio? I know it can be done in the PHP build process for windows as described in the book “Extending and Embedding PHP” by Sara Golemon which I did try but failed with linking errors, maybe because of the config.w32 file not being setup properly. Under linux I have no issues.
Actually the better and recommended way is not to use VS but for debugging.
How about building your own extension? There seems to be a lack of information about doing that on windows
--
Pierre@pierrejoye | http://www.libgd.org
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Hello together,
2014-05-09 12:06 GMT+02:00 O'Neil Delpratt oneil@saxonica.com:
hi,
On Fri, May 9, 2014 at 11:20 AM, O'Neil Delpratt oneil@saxonica.com
wrote:Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than in
Visual studio? I know it can be done in the PHP build process for windows
as described in the book “Extending and Embedding PHP” by Sara Golemon
which I did try but failed with linking errors, maybe because of the
config.w32 file not being setup properly. Under linux I have no issues.Actually the better and recommended way is not to use VS but for
debugging.How about building your own extension? There seems to be a lack of
information about doing that on windows
I also try currently to port over this extension to windows:
https://github.com/piersharding/php-sapnwrfc/issues/6
My progress is not bad...i think there are some incompabilities left
between the versions.....but there are no error messages left at compile
...so its hard to figure out:-/
my resources:
https://wiki.php.net/internals/windows/stepbystepbuild
http://www.php.net/manual/en/internals2.buildsys.configwin.php
http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a-php-extension-for-windows/
the bad things
- there is no real documentation about config.w32 (i've gone through pecl
packages and ported my code from there- at least i didnt found one...
- what are the parameters for functions
like EXTENSION() CHECK_LIB() CHECK_HEADER_ADD_INCLUDE().....??- i guess them currently with the usage in the different pecl packages....
- what kind of functions are available in config.w32?
- the binarys-tools are from 2011...no vc11 folder is created.
http://windows.php.net/downloads/php-sdk/ - in the package i have some lib dependencies -> they must be in the
deps/bin folder- how can i change the source path? only with "--with-extra-libs" ?
- there is the CHECK_LIB() function -> but why the lib is not taken from
there, instead of the deps/bin folder?
Thanks in advance.
Best regards
Martin
Thanks. I will look at the details shortly.
Hello together,
2014-05-09 12:06 GMT+02:00 O'Neil Delpratt oneil@saxonica.com:
hi,
Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than in Visual studio? I know it can be done in the PHP build process for windows as described in the book “Extending and Embedding PHP” by Sara Golemon which I did try but failed with linking errors, maybe because of the config.w32 file not being setup properly. Under linux I have no issues.
Actually the better and recommended way is not to use VS but for debugging.
How about building your own extension? There seems to be a lack of information about doing that on windows
I also try currently to port over this extension to windows:
https://github.com/piersharding/php-sapnwrfc/issues/6
My progress is not bad...i think there are some incompabilities left between the versions.....but there are no error messages left at compile ...so its hard to figure out:-/my resources:
https://wiki.php.net/internals/windows/stepbystepbuild
http://www.php.net/manual/en/internals2.buildsys.configwin.php
http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a-php-extension-for-windows/the bad things
- there is no real documentation about config.w32 (i've gone through pecl packages and ported my code from there
- at least i didnt found one...
- what are the parameters for functions like EXTENSION() CHECK_LIB() CHECK_HEADER_ADD_INCLUDE().....??
- i guess them currently with the usage in the different pecl packages....
- what kind of functions are available in config.w32?
- the binarys-tools are from 2011...no vc11 folder is created. http://windows.php.net/downloads/php-sdk/
- in the package i have some lib dependencies -> they must be in the deps/bin folder
- how can i change the source path? only with "--with-extra-libs" ?
- there is the CHECK_LIB() function -> but why the lib is not taken from there, instead of the deps/bin folder?
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/
Hello together,
the compiled module is now loaded (2 functions work, which dont need the
dll extension from SAP) and its also shown in phpInfo....
But ASAP the extension is executed with dll dependency -> it crashes....
@Pierre
Is it a problem when the dlls are getting partly loaded from
C:\Windows\SysWOW64...
See here the error report:
https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-report_crash-txt-L47-L96
Thanks in advance
Martin
Hi Martin,
Hello together,
the compiled module is now loaded (2 functions work, which dont need the
dll extension from SAP) and its also shown in phpInfo....But ASAP the extension is executed with dll dependency -> it crashes....
@Pierre
Is it a problem when the dlls are getting partly loaded from
C:\Windows\SysWOW64...
See here the error report:
https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-report_crash
-txt-L47-L96
How do you compile the dependency lib? It should use /MD and be non debug
for the release build. Also the dependency build has to match the
corresponding CRT and paltform used for PHP build. Such mistakes are the
frequent reasons for fail. Quite unlikely it has something to do with PHP
itself. For the particular exception 80000003 you experience it would also
make sense to consult something like msdn or stackoverflow as that
exception is a general one and can have many causes.
Regards
Anatol
Hello Anatol,
i hope/think this is the "final" hint...
SAP NW RFC is build with VS2008 (i got the compiled one...so im not 100%
sure) and i compile the php extension itself with VS2012....
I get now VS2008 + Windows SDK 6.1 and try to compile the php extension
with it....
Shouldn't be a problem for PHP 5.5 when the extension is compiled with
VS2008?
2014-05-09 15:38 GMT+02:00 Anatol Belski anatol.php@belski.net:
Hi Martin,
Hello together,
the compiled module is now loaded (2 functions work, which dont need the
dll extension from SAP) and its also shown in phpInfo....But ASAP the extension is executed with dll dependency -> it crashes....
@Pierre
Is it a problem when the dlls are getting partly loaded from
C:\Windows\SysWOW64...
See here the error report:https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-report_crash
-txt-L47-L96
How do you compile the dependency lib? It should use /MD and be non debug
for the release build. Also the dependency build has to match the
corresponding CRT and paltform used for PHP build. Such mistakes are the
frequent reasons for fail. Quite unlikely it has something to do with PHP
itself. For the particular exception 80000003 you experience it would also
make sense to consult something like msdn or stackoverflow as that
exception is a general one and can have many causes.Regards
Anatol
Hello Anatol,
i hope/think this is the "final" hint... SAP NW RFC is build with VS2008
(i got the compiled one...so im not 100%
sure) and i compile the php extension itself with VS2012....I get now VS2008 + Windows SDK 6.1 and try to compile the php extension
with it....Shouldn't be a problem for PHP 5.5 when the extension is compiled with
VS2008?
actually it is a issue, as I mentioned before - the CRT should match. It
is any platform alike with the compatibility between different compiler
versions.
I got it, so that are the bins provided by SAP and of course there are no
sources for that. Maybe they provide some static variant of that lib? that
might work better (but depends how it's built). Or, don't they provide the
vc11 bins, maybe ask support if you can?
Regards
Anatol
2014-05-09 15:38 GMT+02:00 Anatol Belski anatol.php@belski.net:
Hi Martin,
Hello together,
the compiled module is now loaded (2 functions work, which dont need
the dll extension from SAP) and its also shown in phpInfo....But ASAP the extension is executed with dll dependency -> it
crashes....@Pierre
Is it a problem when the dlls are getting partly loaded from
C:\Windows\SysWOW64...
See here the error report:https://gist.github.com/ThaDafinser/e6380157c4f77a3286e5#file-report_cr
ash-txt-L47-L96
How do you compile the dependency lib? It should use /MD and be non
debug for the release build. Also the dependency build has to match the
corresponding CRT and paltform used for PHP build. Such mistakes are
the frequent reasons for fail. Quite unlikely it has something to do
with PHP itself. For the particular exception 80000003 you experience it
would also make sense to consult something like msdn or stackoverflow as
that exception is a general one and can have many causes.Regards
Anatol
Martin,
Hello together,
2014-05-09 12:06 GMT+02:00 O'Neil Delpratt oneil@saxonica.com:
hi,
On Fri, May 9, 2014 at 11:20 AM, O'Neil Delpratt oneil@saxonica.com
wrote:
Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than
in
Visual studio? I know it can be done in the PHP build process for
windows as described in the book “Extending and Embedding PHP” by Sara
Golemon
which I did try but failed with linking errors, maybe because of the
config.w32 file not being setup properly. Under linux I have no issues.Actually the better and recommended way is not to use VS but for
debugging.
How about building your own extension? There seems to be a lack of
information about doing that on windowsI also try currently to port over this extension to windows:
https://github.com/piersharding/php-sapnwrfc/issues/6
My progress is not bad...i think there are some incompabilities left
between the versions.....but there are no error messages left at compile
...so its hard to figure out:-/my resources: https://wiki.php.net/internals/windows/stepbystepbuild
http://www.php.net/manual/en/internals2.buildsys.configwin.php
http://www.dreamincode.net/forums/topic/244215-introduction-to-creating-a-
php-extension-for-windows/the bad things - there is no real documentation about config.w32 (i've
gone through pecl packages and ported my code from there - at least i didnt
found one... - what are the parameters for functions
like EXTENSION() CHECK_LIB() CHECK_HEADER_ADD_INCLUDE().....?? - i guess
them currently with the usage in the different pecl packages.... - what
kind of functions are available in config.w32? - the binarys-tools are
from 2011...no vc11 folder is created.
http://windows.php.net/downloads/php-sdk/
Regarding the config.w32 functions - one possibility is to lookup for them
inside the configure.js as they're regular javascript functions. Generally
I'd appreciate if you could add the issues you mentioned as bug tickets
(one per ticket) and assign to the user ab. It is known but as usual with
the sparse resources it's often to choose either to code or to document.
- in the package i have some lib dependencies -> they must be in the
deps/bin folder - how can i change the source path? only with
"--with-extra-libs" ?
Yes, you can either use --with-extra-libs and --with-extra-includes or
implement --with-myext=path/to/dep (or as an additional option like
--with-myext-deps). Putting the deps into the core deps would work too,
but imho that's an unclean way.
- there is the CHECK_LIB() function -> but why the lib is not taken from
there, instead of the deps/bin folder?
not sure to understand this, *.lib files should be in the deps\lib and if
those libs are some dll import libs, so the corresponding dll should be in
deps\bin
Regards
Anatol
hi,
Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than in Visual studio? I know it can be done in the PHP build process for windows as described in the book “Extending and Embedding PHP” by Sara Golemon which I did try but failed with linking errors, maybe because of the config.w32 file not being setup properly. Under linux I have no issues.
Actually the better and recommended way is not to use VS but for debugging.
How about building your own extension? There seems to be a lack of information about doing that on windows
same, copy it to the ../pecl/ directory, run buildconf etc.
You can use phpize too if your exts do not have dependencies against
other extension.
The process is also described in the wiki
Cheers,
Pierre
@pierrejoye | http://www.libgd.org
Thanks for your help.
hi,
Hi,
Is there a better way to build a PHP C++ extension for PHP 5.5 than in Visual studio? I know it can be done in the PHP build process for windows as described in the book “Extending and Embedding PHP” by Sara Golemon which I did try but failed with linking errors, maybe because of the config.w32 file not being setup properly. Under linux I have no issues.
Actually the better and recommended way is not to use VS but for debugging.
How about building your own extension? There seems to be a lack of information about doing that on windows
same, copy it to the ../pecl/ directory, run buildconf etc.
You can use phpize too if your exts do not have dependencies against
other extension.The process is also described in the wiki
Cheers,
Pierre
@pierrejoye | http://www.libgd.org
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/