By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,694 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,694 IT Pros & Developers. It's quick & easy.

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

P: 6
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($_SESSION)) 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.
http://www.experts-exchange.com/Web_..._22440660.html
Mar 13 '07 #1
Share this Question
Share on Google+
8 Replies


P: 6
Hello about the ASAPI thing, I mean ISAPI
Mar 13 '07 #2

ronverdonk
Expert 2.5K+
P: 4,258
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:
Mar 13 '07 #3

P: 6
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\test.php on line 3
Of if the VIRIABLE is unavailable then it should display like
Notice: Undefined variable: TEST in H:\xxx\xxxx\test.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($_SESSION)) 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 = "zxxxxxxxxxxxxxxxxx";

//make the connection to the database
$connection = mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = mysql_select_db($db_name,$connection)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]
Mar 13 '07 #4

P: 6
When I switched to isapi I had this error on myscript.
Fatal error: Call to undefined function mysql_connect() in S:\xxxxx\xxx\test.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
Mar 13 '07 #5

ronverdonk
Expert 2.5K+
P: 4,258
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:
Mar 13 '07 #6

P: 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:
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.
Mar 13 '07 #7

P: 6
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_redirect=0
;I install in the PHPCGI folder
extension_dir="C:\PHPCGI\ext"
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
[PHP_OPENSSL]
extension=php_openssl.dll
[/php]
Mar 13 '07 #8

ronverdonk
Expert 2.5K+
P: 4,258
Thank you for sharing your solution with our members.

Ronald :cool:
Mar 13 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.