IIS7 Vista ISAPI,CGI mysql , session, variable big prolem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Darwiniv
    New Member
    • Mar 2007
    • 6

    IIS7 Vista ISAPI,CGI mysql , session, variable big prolem

    1. Does anyone run ASAPI and mysql succesfully on Vista /IIS7?
    2. Does anyone run CGI and display all SESSION errors on Vista /IIS7?

    php ASAPI doesn't works with MYSQL.

    And CGI doesn't show any SESSION error message.

    PHP had so much bugs on windows vista.
    I using php-5.2.1-Win32


    <?php
    if (!isset($_SESSI ON)) session_start() ;

    unset($TEST);
    echo $TEST; //line 4

    unset($_SESSION['UserName']);
    echo $_SESSION['UserName']; //line 7
    echo "<br>Hello there";
    echo 'IF you don't see the next line, then php is bugs.';

    $xxxxxx = mysql_connect(' localhost') or die (mysql_error()) ;
    echo 'mysql okay' ;
    ?>

    I posted my question on experts-exchange.com but seem like I don't have the solution yet.
    Last edited by Darwiniv; Mar 13 '07, 08:08 AM. Reason: IIS7 Vista ASAPI,CGI mysql , session, variable big prolem
  • Darwiniv
    New Member
    • Mar 2007
    • 6

    #2
    Hello about the ASAPI thing, I mean ISAPI

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      The MySQL does not work probably because you did not specify the userid and password, like in
      [php]mysql_connect(" localhost", "userid", "password")[/php]

      Is the ";error_log = filename" in php.ini commented out?

      What error messages do you not get? Are you sure you have errors to be shown?

      Ronald :cool:

      Comment

      • Darwiniv
        New Member
        • Mar 2007
        • 6

        #4
        For the mysql with isapi seem like it doesn't communicate with the mysql.
        I had the same set up of the php.ini for cgi and isapi.

        I can use cgi with mysql okay but it just doesn't give my any warning for the SESSION and Variable.

        If use cgi then I don't see any error message when I call the unavailable SESSION.
        Normally if there is an unavailable SESSION the php should display something like
        Notice: Undefined index: UserName in H:\xxxx\xxxx\te st.php on line 3
        Of if the VIRIABLE is unavailable then it should display like
        Notice: Undefined variable: TEST in H:\xxx\xxxx\tes t.php on line 4

        About the error log file, I did remove the; and put the writing directory to
        log_errors = C:\PHP\log.txt

        I just rewrite my code below.[php]
        <?
        if (!isset($_SESSI ON)) session_start() ;

        echo "IF you don't see the next line, then php is bugs with mysql";
        //set up the names of the database and table

        $db_name ="xxx";
        $table_name ="xxxxxxxx";
        $server = "localhost" ;
        $dbusername = "root";
        $dbpassword = "zxxxxxxxxxxxxx xxxx";

        //make the connection to the database
        $connection = mysql_connect($ server, $dbusername, $dbpassword) or die(mysql_error ());
        $db = mysql_select_db ($db_name,$conn ection)or die(mysql_error ());
        echo 'GOOD CONNECT';
        ?>


        <?php
        //TEST WARNING ON CODING SCRIPT.
        unset($TEST);
        echo $TEST; //line 4

        unset($_SESSION['UserName']);
        echo $_SESSION['UserName']; //line 7

        echo "<BR> test ISapi";
        phpInfo();

        ?>[/php]

        Comment

        • Darwiniv
          New Member
          • Mar 2007
          • 6

          #5
          When I switched to isapi I had this error on myscript.
          Fatal error: Call to undefined function mysql_connect() in S:\xxxxx\xxx\te st.php on line 14

          The cgi is doing fine on with the mysql, in fact I had a database and tested it, I can retrieve info from the database okay.
          Again except the warning message

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            I do not know anything about isapi. But obviously isapi does not recognise the PHP mysql_connect command as a valid asapi command. Are you sure that you can write PHP code in isapi?

            As for your errors: they are written to the log file you specified, instead of the screen. For that you set the file off and display_errors = On

            Ronald :cool:

            Comment

            • Darwiniv
              New Member
              • Mar 2007
              • 6

              #7
              Originally posted by ronverdonk
              I do not know anything about isapi. But obviously isapi does not recognise the PHP mysql_connect command as a valid asapi command. Are you sure that you can write PHP code in isapi?

              As for your errors: they are written to the log file you specified, instead of the screen. For that you set the file off and display_errors = On

              Ronald :cool:
              the asapi.dll just the different way to connect to php.exe instead using cgi.exe so I don't think my code is matter.

              I did do the display_errors = On but i recieve no error.

              Comment

              • Darwiniv
                New Member
                • Mar 2007
                • 6

                #8
                I solved a problem with PHP PHP Version 5.2.1 with mysql.
                but my the way thank you for replies ronverdonk.

                If any body interest reading thing problem please follow the instruction below.
                Download the php-5.2.1-win32-installer.msi
                Dowload the mysql server - very easy to install

                Run the PHP 5.2.1 setup
                Make sure select the entension for mysql.

                the php.in should be like below.

                [PHP]
                error_reporting = E_ALL
                cgi.force_redir ect=0
                ;I install in the PHPCGI folder
                extension_dir=" C:\PHPCGI\ext"
                [PHP_MYSQL]
                extension=php_m ysql.dll
                [PHP_MYSQLI]
                extension=php_m ysqli.dll
                [PHP_OPENSSL]
                extension=php_o penssl.dll
                [/php]

                Comment

                • ronverdonk
                  Recognized Expert Specialist
                  • Jul 2006
                  • 4259

                  #9
                  Thank you for sharing your solution with our members.

                  Ronald :cool:

                  Comment

                  Working...