I just finished install and run of PHP and Apache on WinXP.
I have a script that runs clean on a Linux already configured
system (my hosting provider) and I tried to ran the same
script on my local machine. I get errors, which I belive are
due to a missing module of some sort. I just don't know
which module.
"Fatal error: Only variables can be passed by reference"
or the full error:
Fatal error: Only variables can be passed by reference in c:\localhost\treeview\Config\php-dbi.inc.php on line 168
The function itself:
// Retrieve a single row from the database and return it
// as an array.
// Note: we don't use the more useful xxx_fetch_array because not all
// databases support this function.
function dbi_fetch_row ( $res ) {
if ( strcmp ( $GLOBALS["db_type"], "mysql" ) == 0 ) {
return mysql_fetch_array ( $res );
} else if ( strcmp ( $GLOBALS["db_type"], "oracle" ) == 0 ) {
if ( OCIFetchInto ( $GLOBALS["oracle_statement"], &$row,
OCI_NUM + OCI_RETURN_NULLS ) )
return $row;
return 0;
} else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
if ( $GLOBALS["postgresql_numrows"] > $GLOBALS["postgresql_row"] ) {
$r = pg_fetch_array ( $res, $GLOBALS["postgresql_row"]++ );
if ( ! $r ) {
die("Unable to fetch row");
return '';
}
}
else {
$r = '';
}
return $r;
} else if ( strcmp ( $GLOBALS["db_type"], "odbc" ) == 0 ) {
$num_fields = odbc_num_fields ( $res );
if ( ! odbc_fetch_into ( $res, $GLOBALS["odbc_row"]++, &$ret ) ) // THIS IS LINE 168 WHERE ERROR IS
return false;
return $ret;
} else {
dbi_fatal_error ( "dbi_fetch_row(): db_type not defined." );
}
}
The script in question has been (and still is) running perfect on Linux system (two separate systems).
The install on WinXP is the one failing.
My take on this is that something is not enabled just right and therefore it is unable to process it
as it does on the Linux systems.
Any suggestions on what I need to enable? (i.e. any modules that need to be loaded up?).
This is a call to a database (mySql).
PHP Version 4.3.1
MySQL 3.23.49
Apache/1.3.27 (Win32)
WinXP Pro
P4 1.5Ghz
256MB RAM
-Alon.