Menu

php5.3 iis + sql server

Help
Bandorka
2011-06-08
2013-04-22
  • Bandorka

    Bandorka - 2011-06-08

    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

     
  • Bandorka

    Bandorka - 2011-06-08

    Thank you Bob,

    could you help me, how to build a VC9 version? You have some tutorial?

    Thanks
    Andras

     
  • Robert Twitty

    Robert Twitty - 2011-06-08

    For startes you will need to download and install Microsoft VC++ Express Edition and Windows 2008 Platform SDK.

     
  • xianve

    xianve - 2011-06-08

    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.

     
  • Robert Twitty

    Robert Twitty - 2011-06-09

    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)?

     
  • Bandorka

    Bandorka - 2011-06-09

    I do not know the difference. Could you explain?

     
  • Bandorka

    Bandorka - 2011-06-09

    Since i am using the newest iis with Fastcgi , i guess the non thread safe version is needed. Am i right?

     
  • Robert Twitty

    Robert Twitty - 2011-06-09

    Yes

     
  • Bandorka

    Bandorka - 2011-06-09

    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

     
  • Robert Twitty

    Robert Twitty - 2011-06-09

    Are you able to obtain the one successfully compiled by xianve?

     
  • xianve

    xianve - 2011-06-09

    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

     
  • Bandorka

    Bandorka - 2011-06-10

    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

     
  • Robert Twitty

    Robert Twitty - 2011-06-10

    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
     
  • Bandorka

    Bandorka - 2011-06-10

    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!!!!!

     
  • Robert Twitty

    Robert Twitty - 2011-06-10

    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.

     
  • Bandorka

    Bandorka - 2011-06-12

    Thank you bob,
    I recompiled it and works great! Thank you! You need me to post you the compiled dll?

    Andras

     
  • Robert Twitty

    Robert Twitty - 2011-06-13

    Yes.

    Christian, I added you to the project.  So, you can upload your files.

    Thanks!

    • bob
     

Log in to post a comment.