SmootQ
SmootQ

Reputation: 2122

VC compiler version for php extensions creation

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

Upvotes: 1

Views: 1976

Answers (1)

wkl
wkl

Reputation: 79911

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.

Upvotes: 1

Related Questions