1

I've worked with Visual Studio 2008(visual c) to create a php extension, so after writing the c code and compiling the whole project, A dll file has been generated in the debug folder. I copied this dll file to the php /ext folder ( extensions folder) and I added this line in php.ini

extension=php_talkphp.dll (php_talkphp.dll is the dll name)

then I restart apache server to initialise php extensions. but an error has occured : and this is the error message:

alt text

I know that this is due to the compiler version, but How can I use the Vc6 version in a VS2008?

thank you

1
  • Maybe My question needs some explanation!
    – SmootQ
    Dec 7, 2010 at 22:08

1 Answer 1

1

You need to use the extensions built with the same compiler as your PHP install.

In this case - you are using an installation of PHP built with Visual C++ 6, which is an incredibly old compiler. Your extension is built with Visual C++ 9.0, which is much newer.

You can not mix extensions and PHP installs built with different VC compilers.

Possible solutions:

  • Get the TalkPHP extension built with Visual C++ 6, and build your own with VC6. You probably will have a hard time getting this since it's an unsupported, unavailable compiler.

or

  • Install a version of PHP built with Visual C++ 9.0. This will introduce different problems however:
    1. You will either need to switch to using IIS or use a version of apache built with Visual C++ 9.0. Apache Lounge has them.
    2. You will have to install the Visual C++ 9.0 Runtime if you don't already have it.
2
  • thank you for this reply, but isn't it possible to add a VC6 compiler to a VC++ 9??
    – SmootQ
    Dec 8, 2010 at 10:47
  • @Simo TAQI - You can not mix PHP binaries with extensions built with a different Visual C++ compiler, because they use different and incompatible implementations of Microsoft's C++ library, so if they were to start passing stuff like containers between each other, there would be problems.
    – wkl
    Dec 8, 2010 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.