Search


Hot Tags

Forum Neo22s » Open Classifieds

Install error

(6 posts)

  1. nelloxa
    Member

    Hello
    I tried to install Open Classifieds but I had the following issues :
    1) Step 4 : Please enter your MySQL database details below
    my test DB is a local EasyPHP installation, for which the root password is "". Your JS does not approve it (easily solved by disabling checkForm() )
    2) After clicking the "install", I obtain a page declaring "failure". After digging in the code, it seems that the error comes from the line in sql.php :

    "ALTER TABLE posts ADD CONSTRAINT FK_posts_categories FOREIGN KEY (idCategory) REFERENCES categories (idCategory) ON DELETE CASCADE ON UPDATE CASCADE"

    MySQL error code is #1005 - Can't create table 'openclassifieds.#sql-ee0_3e' (errno: 121).
    I've searched for it and the error comes qith InnoDB tables, when the foreign key declaration is not exactly the same that should be.
    Here we have :
    in Categories table : idCategory int(10) unsigned NOT NULL auto_increment,
    in Posts table : idCategory int(10) unsigned NOT NULL default '0',
    the difference can be the reason for the problem.
    Info on the subject :

    http://www.verysimple.com/blog/2006/10/22/mysql-error-number-1005-cant-create-table-mydbsql-328_45frm-errno-150/

    Can you have a look of it ? And... could you please change the "failure" messages to something more easy to debug ? A simple "Failure #1", "Failure #2"... can help a lot.
    Thanks
    Nello
    _____________________________________
    I run Apache 2.2.13, MySQL 5.1.37 and PHP 5.3.0

    Posted 9 months ago #
  2. Chema
    Key Master

    Hello,

    I'm improving the installation already, thanks for the feed back.

    It's weird what happens to you. Did exist already a OC installation? because if the DB already exists is a commmon error.

    My recommendation to you is to erase the DB and files if you have it and run the installation once more.

    Regards!

    Posted 9 months ago #
  3. nelloxa
    Member

    Tried again after dropping the DB: Apache crashes...
    That happens on my installation if there are MySQL queries to nonexistent DB or if I try to connect to a DB without initializing the connection.
    I will try again tomorrow.
    Regards

    Posted 9 months ago #
  4. nelloxa
    Member

    Found a few issues in sql.php :
    - line 18 : missing the "die" part. Should be :

    mysql_query($sqlImport) or die("failure");

    - some duplicates ";;" at the end of the line. To be cleaned.

    I finally managed to install via Phpadmin: I wrote the queries directly in SQL.

    Posted 9 months ago #
  5. nelloxa
    Member

    Hi
    I'm tracking the Apache crash issue. PHP 5.3 (and before) can crash in case of MySQL connections opened and closed without using handles :

    /*
    * php-cgi.exe OK
    */
    $a=mysql_connect('127.0.0.1:3306', 'root', 'fdgdfgd'));
    mysql_close($a);

    /*
    * php-cgi.exe CRASH
    */
    mysql_connect('127.0.0.1:3306', 'root', 'fdgdfgd'));
    mysql_close();

    the same happens with mysql_connect(). The solution is to implement handlers for your install.php and ocdb.php (at least).

    Statements like the following should be avoided since they crash.
    if (!mysql_connect(DB_HOST,DB_USER,DB_PASS))

    I know, the bug is PHP's and not yours !!

    Bye
    _______________________
    PHP bug report on the issue :
    http://bugs.php.net/bug.php?id=48754

    Posted 8 months ago #
  6. Chema
    Key Master

    Thanks for the info,

    It's funny since I only close the mysql connection at the end for improvements reasons.

    regards

    Posted 8 months ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

Top Footer
Follow me