PHP 5.1.2 with embedded-mysqli
am 05.04.2006 10:45:58 von Jean-Philippe BraunHi,
I am trying to use php with libmysqld. I manage to compile php on windows
2000 with cygwin because I am used to deal with Unix systems.
I have compiled php using --with-mysqli --enable-embedded-mysqli
--with-xsl options (cgi version). Then I have tried the php examples in
php-src/ext/mysqli/tests/ on a innodb DB that works.
With a binary version of php 5.1.2 (doesn't include libmysqld) I can
access to the DB without problems using this script (table test on
database test is innoDB) :
$link =3D mysqli_connect("127.0.0.1", "root", "", "test", 3306);
if (mysqli_connect_errno()) {
=09printf("Echec de la connexion : %s\n", mysqli_connect_error());
=09exit();
}
$result =3D mysqli_query($link, "SELECT * FROM test");
while ($row =3D mysqli_fetch_array($result, MYSQLI_NUM)) {
printf ("ID: %s Name: %s
", $row[0], $row[1]);
}
?>
But when I try with my own php with mysqli embedded (on the same DB and
mysqld is down) with this script (just tring to connect) :
if (!extension_loaded('mysqli')){
=09die('skip mysqli extension not available');
}
$driver =3D new mysqli_driver();
if (!$driver->embedded) {
=09echo 'Mysqli embedded disabled';
} else {
=09$path =3D "/cygdrive/c/Program Files/EasyPHP1-8/mysql/data";
=09$host =3D $user =3D $passwd =3D NULL;
=09$args =3D array(
"--datadir=3D$path",
"--innodb_data_home_dir=3D$path",
"--innodb_data_file_path=3Dibdata1:100M:autoextend",
"--innodb_force_recovery=3D4",
"--innodb_log_group_home_dir=3D/cygdrive/c/Program
Files/EasyPHP1-8/mysql/logs/",
"--innodb_log_files_in_group=3D2",
"--innodb_log_archive=3D1",
"--innodb_log_arch_dir=3D/cygdrive/c/Program
Files/EasyPHP1-8/mysql/logs/",
"--innodb_lock_wait_timeout=3D10",
"--log-error=3D$path/testrun.log"
=09);
=09$driver->embedded_server_start(TRUE, $args, NULL);
=09var_dump($driver);
=09$driver->embedded_server_end();
}
?>
I'm getting a seg fault :
$ php test_embedded.php
060405 10:35:26 [Warning] Setting lower_case_table_names=3D2 because file
system for /cygdrive/c/Program Files/EasyPHP1-8/mysql/data/ is case
insensitive
Segmentation fault (core dumped)
On the log file (testrun.log) I get this error :
InnoDB: Fatal error: cannot read from file. OS error number 17.
InnoDB: Error: tried to read 16384 bytes at offset 0 0.
InnoDB: Was only able to read -1.
I've checked the permissions, everyone has the rights to
write/read/execute all the files (on windows/cygwin)
Both php (compiled and binary version) have the same innodb options...
So what's going on ? Is my own php miss configured ?
Thank you very much.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php