PHP works with SQL anywhere 10...

Discussion in 'PHP' started by sweeleen, Jun 24, 2007.

  1. #1
    Hi, all.
    Currently I m requesting by my manager that to configure PHP works with SQL anywhere 10. But, after i try to configure it. I get tis error msg-->

    PHP Warning: PHP Startup: sqlanywhere: Unable to initialize module Module compiled with module API=20050922, debug=0, thread-safety=1 PHP compiled with module API=20060613, debug=0, thread-safety=1 These options need to match in Unknown on line 0 PHP Fatal error: Call to undefined function sqlanywhere_connect() in C:\Program Files\SQL Anywhere 10\src\php\examples\connect.php on line 2

    I am wondering what this error means and how to solve this?

    Here are the steps that I configure PHP and SQL anywhere 10.
    1. I installed PHP 5.3.2 without any extension.
    2. I copy php-5.1.2_sqlanywhere10.dll this file from SQL anywhere 10 and paste into C:\PHP\ext folder.
    3. I modified the code in PHP.ini by adding this line
    extension=php-5.1.2_sqlanywhere10.dll only.
    4. I start my server in the sample database provided by SQL anywhere 10.
    5. I run my connect.php in IIS, then it gets these errors.

    I know the version of SQL anywhere 10 is not compatible with PHP version. But, I am following the steps provided by this link:
    http://www.ianywhere.com/developer/product_manuals/sqlanywhere/1000/en/html/dbpgen10/pg-php-s-4387280.html

    Here is my code for connect.php
    <?php
        $conn = sqlanywhere_connect( "uid=dba;pwd=sql" );
    
        if( ! $conn ) {
    	echo "Connection failed\n";
        } else {
    	echo "Connected successfully\n";
    	sqlanywhere_disconnect( $conn );
        }
    
    ?>
    PHP:
    Is it anything that I miss out? Anyone with the solution can you please share with me ? Thankyou.

    PHP-->5.3.2
    SQL Anywhere-->10
    IIS-->5.0
    OS--> Window XP SP 2
     
    sweeleen, Jun 24, 2007 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As per the error message, the version of the SQLAnywhere module you are using is not the same as the PHP version that you are using.

    Try and get the appropriate module for the PHP version you are using, otherwise compile it yourself.
     
    TwistMyArm, Jun 25, 2007 IP
  3. sweeleen

    sweeleen Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ya. It was different version.

    But I dunno how to compile it by myself.

    Anyone here can share with me the method of compiling myself ?:confused:
     
    sweeleen, Jun 25, 2007 IP