The rough steps I recorded to compile the extension.
1. Download and install Win 2008 Platform SDK. Place it's Include and Lib directories in front of directories listed for INCLUDE and LIB environment variables, and VC9 Visual Studio's Include and Library directory settings.
2. Copy odbtp/odbtp.h from CVS into Platform SDK's Include directory, and copy odbtp/winclient/libodbtp.lib from CVS into Platform SDK's Lib directory.
3. Download and unzip PHP 5.3.4 source code for windows.
4. Copy odbtp/php/ext/odbtp from CVS into php-5.3.4\ext.
5. Open a command window and run the following under the PHP 5.3.4 source distribution root directory (php-5.3.4):
buildconf
configure
6. Create a directory under php-5.3.4 called Release and copy dev\php5.lib from php-5.3.4-nts-Win32-VC9-x86.zip into it. Rename it to php5nts.lib.
7. Open php-5.3.4\win32\php_modules.dsw within VC9 Visual Studio, and then add the php-5.3.4\ext\odbtp\odbtp.dsp project file to the workspace.
8. Set the active configuration to "Release", and then build it.
9. Disable all other projects from building
10. Remove ZTS=1 from Precompiler settings
11. Adjust php5ts.dll to php5nts.dll in Linker
12. Correct ZVAL_ADDREF to Z_ADDREF_P in php_odbtp.c
13. If there are no problems, php_odbtp.dll will be created under php-5.3.4\Release.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Step 12 will not be required if you use the odbtp PHP extension code residing in CVS. Also, did you want the the thread safe (TS) or non-thread safe version (NTS)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Bob, yes sent it off to Andras.
If you add me to the project I can upload the file for others.
Looking forward to help out where I can.
All the best, Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you xianve!!! I received it, but still something is wrong, when i use any database query i get 500 internal server error.
Can you think of what could be wrong?
I use php 5.3.6
Thank you,
Andras
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Another way to test the extension is to write a PHP script that simply connects to the DB, runs a simple query, and outputs the results. However, instead of running it via IIS, run it directly with the PHP interpreter within a command line window. For example:
C:\>\php\php.exe test.php
bob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Can anyone help me with the problem? php53 does not work with odbtp. What can i do? Has anyone compiled the dll yet?
I have iis6 + sql server 2008
Thanks
Bandorka
A 5.3 dll for PHP 5.3 VC6 is in the CVS. There is not one yet for VC9. The following threads may be useful for compiling with VC9:
http://sourceforge.net/projects/odbtp/forums/forum/239284/topic/4029879
http://sourceforge.net/projects/odbtp/forums/forum/239284/topic/3441926
Thank you Bob,
could you help me, how to build a VC9 version? You have some tutorial?
Thanks
Andras
For startes you will need to download and install Microsoft VC++ Express Edition and Windows 2008 Platform SDK.
Let me know your e-mail and I'll send it to you.
The rough steps I recorded to compile the extension.
1. Download and install Win 2008 Platform SDK. Place it's Include and Lib directories in front of directories listed for INCLUDE and LIB environment variables, and VC9 Visual Studio's Include and Library directory settings.
2. Copy odbtp/odbtp.h from CVS into Platform SDK's Include directory, and copy odbtp/winclient/libodbtp.lib from CVS into Platform SDK's Lib directory.
3. Download and unzip PHP 5.3.4 source code for windows.
4. Copy odbtp/php/ext/odbtp from CVS into php-5.3.4\ext.
5. Open a command window and run the following under the PHP 5.3.4 source distribution root directory (php-5.3.4):
buildconf
configure
6. Create a directory under php-5.3.4 called Release and copy dev\php5.lib from php-5.3.4-nts-Win32-VC9-x86.zip into it. Rename it to php5nts.lib.
7. Open php-5.3.4\win32\php_modules.dsw within VC9 Visual Studio, and then add the php-5.3.4\ext\odbtp\odbtp.dsp project file to the workspace.
8. Set the active configuration to "Release", and then build it.
9. Disable all other projects from building
10. Remove ZTS=1 from Precompiler settings
11. Adjust php5ts.dll to php5nts.dll in Linker
12. Correct ZVAL_ADDREF to Z_ADDREF_P in php_odbtp.c
13. If there are no problems, php_odbtp.dll will be created under php-5.3.4\Release.
Step 12 will not be required if you use the odbtp PHP extension code residing in CVS. Also, did you want the the thread safe (TS) or non-thread safe version (NTS)?
I do not know the difference. Could you explain?
The following might help explain the difference:
http://www.iis-aid.com/articles/my_word/difference_between_php_thread_safe_and_non_thread_safe_binaries
Since i am using the newest iis with Fastcgi , i guess the non thread safe version is needed. Am i right?
Yes
Well it compiles but does not work.
10. Remove ZTS=1 from Precompiler settings
11. Adjust php5ts.dll to php5nts.dll in Linker
These steps i could not do. I did not find the options in VS 2008
Andras
Are you able to obtain the one successfully compiled by xianve?
Hi Bob, yes sent it off to Andras.
If you add me to the project I can upload the file for others.
Looking forward to help out where I can.
All the best, Christian
Thank you xianve!!! I received it, but still something is wrong, when i use any database query i get 500 internal server error.
Can you think of what could be wrong?
I use php 5.3.6
Thank you,
Andras
Another way to test the extension is to write a PHP script that simply connects to the DB, runs a simple query, and outputs the results. However, instead of running it via IIS, run it directly with the PHP interpreter within a command line window. For example:
C:\>\php\php.exe test.php
Sensational!!! It works! however it is important to highline that after this build the mssql commands have to be replaced with odbtp:
mssql_connect -> odbtp_connect etc…
Thank you a million times!!!!!
Support for mssql_* functions can be included in the extension by uncommenting the line in php_odbtp.c that defines ODBTP_MSSQL prior to compilation.
Thank you bob,
I recompiled it and works great! Thank you! You need me to post you the compiled dll?
Andras
Yes.
Christian, I added you to the project. So, you can upload your files.
Thanks!