L.S.

I can't get PHP5 / MySQLi (improved mysql) working.
Here's the setup:

        Linux
        apache-2.0.50
        mozilla
        mysql-4.1.3
        php-5.0.0RC3 (configured --with-mysqli --without-mysql)

All are compiled and installed as per their respective configure files
and Makefiles (PHP developers take note: php needed a manual addition
of ZEND_EXTRA_LIBS=-lstdc++ after configure ran).

I have mysqld and apache running.  Mysqld runs as user mysql.mysql,
Apache runs as www.sys.  MySQL itself and Apache itself are working
flawlessly, and I've been using them for some time now.
Also php is installed with proper php.ini that's basically the one
from the package (php-medium.ini).  From Mozilla, this script for
instance runs fine:

-------
<html>
<head><title> phptest.php -- PHP / MySQLi Test </title></head>
<body>
<?
echo $_SERVER['HTTP_USER_AGENT'];
phpinfo();
?>
</body>
</html>
-------


Then in Mozilla I load this script, mysqli.php:

-------
<html>
<head>  <title> mysqli.php -- PHP / MySQLi Test </title> </head>
<body>
<?php
$database="MYDB";
$table="`TABLE`";

$link = mysqli_connect( "localhost", "root", "xxxxxxxx", $database );
if (!$link) {
        printf( "<P>unable to connect to the MySQL server at this time; error: %s</P>",
        mysqli_connect_error() );
        exit();
}

$sql = "select * from " . $table . ";";
if (($result=mysqli_query( $link, $sql ))) {
        echo( "<font face=fixed>" );
        while ( $row = mysqli_fetch_assoc( $result ) ) {
                printf( "%s %s<br>", $row["Name"], $row["Date"] );
        }
        echo( "</font>" );
        mysqli_free_result( $result );
}
else {
        echo( "<P>error getting table " . $table . "</P>");
}

mysqli_close( $link );
?>
</body>
</html>
-------


This script, mysqli.php, runs (mutatis mutandis) fine from Mozilla under
the 'old' PHP4/MySQL.

With this PHP5/MySQL setup however, it doesn't produce any output.  Tailing
the Apache error.log there's this message:


  InnoDB: unable to create /usr/local/lib/mysql-4.1.3/var//innodb.status.1731:
  Permission denied
  040704 17:11:20  Can't init databases
  [Sun Jul 04 17:11:21 2004] [notice] child pid 1728 exit signal Segmentation
  fault (11)


This is with the mysql data-directory (/usr/local/lib/mysql/var/) set at
permissions 755 (or 700 or 711), and user mysql.myqsl (as per the docs).

So then I tried /usr/local/lib/mysql/var/ at permissions 777.
Now the Apache error.log has:


  040704 17:14:24  InnoDB: Operating system error number 13 in a file operation.
  InnoDB: The error means mysqld does not have the access rights to
  InnoDB: the directory.
  InnoDB: File name /usr/local/lib/mysql-4.1.3/var/ibdata1
  InnoDB: File operation call: 'open'.
  InnoDB: Cannot continue operation.


But still no go.  I've played with other permissions, also for the Apache
User/Group, libphp5.so, different parameters for mysqli_connect(), and quite
a few other things, but I'm getting nowhere.

The above script by the way does run OK with PHP5/MySQLi if I run it with
php from the command-line, but only if the mysqld server is /not/ running.
I suppose that's at least normal behaviour.

I'm ready for any good suggestions and tips.

Thanks for your time.

BJ

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to