I am trying to compile a third party library into a dll
to use in PHP5.6.31
. By following the php build directions here, and the dll's reference guide (select 'Using lpsolve from PHP' from the index and scroll down to the compile section). This is what i did.
- Downloaded the PHP source
php-5.6.31-src.zip
from here. - Downloaded the binary tools
php-sdk-binary-tools-20110915.zip
from here. - Downloaded the php libraries
deps-5.6-vc11-x86.7z
from here. - Set up the build directory and extracted both the source files and the deps to this directory
C:\php-sdk\phpdev\vc11\x86\
. - Downloaded
lp_solve_5.5.2.5_dev_win32.zip
here and extracted them toC:\lp_solve_5.5
. - Downloaded
lp_solve_5.5.2.5_PHP_source.tar.gz
here and extracted it, then from the extracted files copied this folderlp_solve_5.5\extra\PHP
toC:\php-sdk\phpdev\vc11\x86\php-5.6.31-src\ext\lp_solve_5.5
. - Opened
VS2012 x86 Native Tools Command Prompt
that came with Visual Studio 2012. - Ran
C:\php-sdk>bin\phpsdk_setvars.bat
thenC:\php-sdk\phpdev\vc11\x86\php-5.6.31-src>buildconf
. - Ran
C:\php-sdk\phpdev\vc11\x86\php-5.6.31-src>cscript /nologo configure.js --without-xml --without-wddx --without-simplexml --without-dom --without-libxml --disable-zlib --without-sqlite3 --disable-odbc --disable-cgi --enable-cli --without-iconv --enable-phplpsolve55=shared --with-phplpsolve55path="C:\lp_solve_5.5"
. - Ran
nmake php_phplpsolve55.dll
which created a dll namedphp_phplpsolve55
in this directoryC:\php-sdk\phpdev\vc11\x86\php-5.6.31-src\Release_TS
. - I then copied
php_phplpsolve55
to my wampserver php extensions folderC:\wamp\bin\php\php5.6.31\ext
. - Added this line to my
php.ini
fileextension=php_phplpsolve55.dll
.
Then I restarted Wampserver, but the php_lpsolve55
extension does not show up in the loaded extensions. I checked the php_error log and this is the error.
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_phplpsolve55.dll' - The specified module could not be found. in Unknown on line 0
Are there any other ways to troubleshoot this other than the php_error log?
From other posts I read maybe this is a compiler compatibility issue?
Here is my WampServer version.
WampServer version 3.1.0 - 32bit
Apache version: 2.4.27
PHP version: 5.6.31
And here are a few properties from phpinfo()
Compiler: MSVC11 (Visual C++ 2012)
PHP Extension Build: API20131226,TS,VC11
Thread Safety: enabled
Note: I changed line 5 of C:\php-sdk\phpdev\vc11\x86\php-5.6.31-src\ext\lp_solve_5.5\PHPmod.c
to static zend_function_entry php_phplpsolve55_functions[] = {
I got this from this post.