[closed]

Apache error : Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

(20 posts) (2 voices)

Tags:

  1. piv
    Member

    Hello,

    I have some problems to install and configure thescrum on my server.
    Details
    Windows Server 2003 Std Apache 2 / PHP 5.3 / Mysql 5.1

    This server is used also for other web site.

    I follow your tutorial but when I go on thescrum site, I have nothing ( No authentification popup ). No error on the page, just a white page.

    I have this Apache error :

    PHP Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in D:\\www\\thescrum\\_classes\\classloader.php on line 2

    I try with XAMPP on a different serveur >> no problème, all work correctly.

    Thanks you very much for your support

    Regards

    Piv

    Posted 2 years ago #
  2. admin
    Key Master

    Hi,
    Doing a bit of Google search regarding this error, I found:
    http://bugs.php.net/bug.php?id=47224

    Try looking at the following line in your PHP.INI file:

    extension=php_pdo_mysql_libmysql.dll

    If it's commented, then uncomment it, restart your server, and hopefully it will work :)

    Otherwise, I fear you must upgrade to PHP 5.3.1 according to the bug.

    Hope it helps,
    Nicolas

    Posted 2 years ago #
  3. piv
    Member

    Hi,

    Well, I use now Xampp ( I use only Apache and PHP ) and I keep my mysql
    version.
    I restaured thescrum database ( from the other server where thescrum was
    installed ) all is ok.
    Exept when we would like to create new project, we have this error :

    Fatal error: Uncaught exception 'Exception' with message 'Object not found' in D:\www\thescrum\_classes\class_object.php:29 Stack trace: #0 D:\www\thescrum\_classes\class_projectdisplay.php(8): PBObject->__construct(0, true) #1 D:\www\thescrum\_ajax\project\add_db.php(5): ProjectDisplay->__construct(0) #2 D:\www\thescrum\_ajax\object_add_db.php(6): include('D:\www\thescrum...') #3 {main} thrown in D:\www\thescrum\_classes\class_object.php on line 29

    Thanks

    Regards

    Piv

    Posted 2 years ago #
  4. admin
    Key Master

    Scratching my header on this one ... I would say it suggests a problem of connection with the database. If you are using Xampp, pls check the error log, usually located at: C:\xampp\apache\logs\error.log and let me know if there is any meaningful error.
    Nicolas

    Posted 2 years ago #
  5. piv
    Member

    Hi,
    Here is the error on apache log

    [Thu Dec 10 09:56:55 2009] [error] [client 192.168.1.73] SQLSTATE HY000 - Field 'pro_velocity' doesn't have a default value, referer: http://methode/thescrum/project-dashboard

    We arrive to create a Story on existing projects ( I checked on database and it was create ).
    apparently, we have problem only when we would like to create new project.
    Thank you for your support.

    Regards

    Piv

    Posted 2 years ago #
  6. admin
    Key Master

    Hi Piv,
    Could you pls apply the following SQL query on your database:

    ALTER TABLE project CHANGE pro_velocity pro_velocity DECIMAL(3, 1) NOT NULL DEFAULT 0;

    I believe your MySQL server is behaving slightly different than mine on default values... If that works, I will update the create.sql in the next revision of theSCRUM.

    Also, you mentioned "I try with XAMPP on a different serveur" -> could you let me know if you have the same problem on both servers?

    Thank you, sorry about this issue...
    Nicolas

    Posted 2 years ago #
  7. piv
    Member

    Hi,

    I changed last week the default value to 0 and it's work fin now.

    I have a final request :) , concerning the sheduled task with "generate_sprint_snapshots.php". I created the shedule to execute this pfp file, but it's don't work. apparently it's blok at this line :

    $DB = new PDO('mysql:host=' . PRODUCTBACKLOG_DB_HOST . ';dbname=' . PRODUCTBACKLOG_DB_NAME, PRODUCTBACKLOG_DB_USER, PRODUCTBACKLOG_DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));

    I check all var and it's ok. I check my script with our old thescrum web site and all work correctly.

    Thank you for your support and sorry for the disturbe

    Regards
    Piv

    Posted 2 years ago #
  8. admin
    Key Master

    Hi,
    do you have any message in the ERROR.LOG ? Also, as you are on windows, which scheduling system do you use? (I'm not that familiar with Windows).
    Nicolas

    Posted 2 years ago #
  9. piv
    Member

    Hi,

    At this time, I don't use the scheduling system, I create a Bat file :
    D:\xampp\xampp\php\php -f d:\www\thescrum\generate_sprint_snapshots.php

    And I have no message on error.log.

    piv

    Posted 2 years ago #
  10. admin
    Key Master

    What may happen : I'm using relative paths that are not recognized by PHP command line on Windows...

    In the "generate_sprint_snapshots.php", change all the "include_once" statements by using absolute paths. For instance:

    include_once '_classes/class_object.php';
    By:
    include_once 'd:/www/thescrum/_classes/class_object.php';

    Nicolas

    Posted 2 years ago #
  11. piv
    Member

    Hi,

    I have the same problem.

    When I start the bat, I have nothing

    On our other thescrum web server I have :
    "Taking Snapshot of spring #1"
    "Taking Snapshot of spring #5"

    Ragards

    piv

    Posted 2 years ago #
  12. admin
    Key Master

    Silly question: is there any sprint currently running ? (a running sprint is a sprint for which the current date is between the start date and end date).

    For the next revision of theSCRUM, I have changed "generate_sprint_snapshots.php" in the following way:

    if ($activeSprints) {
    ...
    } else {
    echo 'Do nothing as there is no active sprints' . PHP_EOL;
    }

    So that we won't be fooled in case of there is no active sprint...

    Hopefully, this is as simple as that ;)

    Posted 2 years ago #
  13. piv
    Member

    Hi,

    Same issue.

    The problem is in the line :
    $DB = new PDO('mysql:host=' . PRODUCTBACKLOG_DB_HOST . ';dbname=' . PRODUCTBACKLOG_DB_NAME, PRODUCTBACKLOG_DB_USER, PRODUCTBACKLOG_DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));

    I whrite echo 'test before'; and echo'test 'after'; after and before this line $DB....... and only the "echo before" appear on the php command.

    he block at this line and don't continue.

    This line is on the classloader.php and apparently I have no problem with it.
    I have no problem to connect on my database ( users manage and update the database at this time ).

    I continue to investigate on it

    Regards

    Piv

    Posted 2 years ago #
  14. admin
    Key Master

    That's really weird... No problem when calling it thru the browser?
    http://..../thescrum/generate_sprint_snapshots.php

    Posted 2 years ago #
  15. piv
    Member

    No problem, I have thescrum default page but nothing happened for sprint snapshot

    Posted 2 years ago #
  16. admin
    Key Master

    Ok... Try encapsulating the call to DB into a try/catch statement:

    try {
    $DB = new PDO('mysql:host=' . PRODUCTBACKLOG_DB_HOST . ';dbname=' . PRODUCTBACKLOG_DB_NAME, PRODUCTBACKLOG_DB_USER, PRODUCTBACKLOG_DB_PASS, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
    } catch (Exception $e) {
    echo "Failed: " . $e->getMessage();
    }

    Hopefully you will get a message :)

    Posted 2 years ago #
  17. piv
    Member

    I already test it this morning but.... without result

    I don't understand what happen, we arrived to connect on the database ( users used thescrum at this time ) and we have a problem with this file.

    What it will happen exactly if I include classloader.php on generate_sprint_snapshots.php

    Posted 2 years ago #
  18. admin
    Key Master

    I don't think including classloader.php will change anything, as it is basically a list of includes. generate_sprint_snapshots.php only contains the mandatory includes, not more.

    If you write "echo PRODUCTBACKLOG_DB_HOST" before "$DB = new PDO", do you have the right value set in global.php that is displayed?

    Posted 2 years ago #
  19. piv
    Member

    Hi,

    Well, Great news, I imported all my databases on xampp mysql and now I use the mysql of xampp.
    All work correctly now ( maybe I had a problem during the imporation of my data ? I don't know ).

    Thank you very much for your support and your patience :)

    Best regards

    Piv

    Posted 2 years ago #
  20. admin
    Key Master

    Great news !!! Happy to close this topic ;)
    Let me know how and why you use theSCRUM; I could write a blog post on your usage.
    Thanks,
    Nicolas

    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.