The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pdo_mysql

Discussion in 'General Discussion' started by Olate, May 14, 2006.

  1. Olate

    Olate Active Member

    Joined:
    Aug 1, 2003
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    I have just updated Apache and installed MySQL 5.0.18 and PHP 5.1.2 through the Apache Update script in cPanel. This has built PDO in with the sqlite2, sqlite drivers but it doesn't have the pdo_mysql driver.

    I have tried running pecl install pdo_mysql but I get this error

    Code:
    Configuring for:
    PHP Api Version:         20041225
    Zend Module Api No:      20050922
    Zend Extension Api No:   220051025
    /usr/local/bin/phpize: /tmp/tmp7Devhw/PDO_MYSQL-1.0.2/build/shtool: /bin/sh: bad interpreter: Permission denied
    Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
    environment variable is set correctly and then rerun this script.
    
    ERROR: `phpize' failed
    So I tried a manual install using phpize but I get this error:

    Code:
    checking for PDO includes... checking for PDO includes... /usr/local/include/php/ext
    configure: error:
    You've configured extension pdo_mysql, which depends on extension pd
    So I'm not sure what to do now. Anyone got any suggestions?
     
  2. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Kinda of odd we was asked for this today as well :eek:

    Anyway we compiled it into php (we are using v 5.1.4) by adding the following to our configure line --enable-pdo --enable-pdo_mysql

    We asked the customer to see if it will work for them and report back. So I cannot tell you if it will do the trick but it might be something you can do and test yourself (And let us know as well)
     
  3. Olate

    Olate Active Member

    Joined:
    Aug 1, 2003
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    That would require compiling PHP manually, which we've done on our other server, but our customer server needs to have PHP suexec too which requires me to use the cPanel build apache script.
     
  4. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    It doesn't have seemed to have fixed the problem anyway :) So the search continues

    My Edit ---------

    Although this probably will not help you since you cannot compile manually, it might help someone else we added

    To our configure line for php and it solved our problem with install pdo for use with mysql.
     
    #4 rhenderson, May 20, 2006
    Last edited: May 20, 2006
  5. twhite

    twhite Registered

    Joined:
    Aug 18, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    The problem is that the /tmp and /var/tmp directories are noexec, which prevents pecl build scripts from running.

    I tried numerous way of trying to get pecl to change it's tmp directory and build directory to no avail.

    Here is what I did to resolve the problem
    mkdir /root/tmp.pear
    mkdir /root/tmp.pear-build-root
    rm -rf /tmp/pear*
    ln -s /root/tmp.pear /tmp/pear
    ln -s /root/tmp.pear-build-root /tmp/pear-build-root

    pecl install pdo_mysql should now work.
     
  6. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Yes you are right that error is because of noexec /tmp, which I recently learned trying to install; pecl install mailparse and pecl install json, but again pdo was easy to install via recompiling php.
     
  7. flavio

    flavio Member

    Joined:
    Mar 7, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    unhappyly this did not resolved :(
     
  8. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Lol, you dug up a 4 1/2 month old thread. As I put above, pdo_mysql is part of PHP now, just recompile PHP and add the switch to enable it.
     
  9. asiams

    asiams Well-Known Member

    Joined:
    May 28, 2003
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hokkaido, JAPAN
    recomplied but not recogizing the change yet?

    I have recompiled at [/home/cpapachebuild/buildapache/php-5.2.0] where the cpanel built php-5.2.0.

    I did under that directory like this:

    ./configure --enable-pdo=shared --with-pdo-mysql=shared
    make
    make install
    restarted apache

    it went all the way through without any problem.

    However, it still did not show from phpinfo.

    Did I miss anything?

    Thanks.

    asiams.
     
  10. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Instead of

    Code:
    --enable-pdo
    Try

    Code:
    --with-pdo
     
  11. asiams

    asiams Well-Known Member

    Joined:
    May 28, 2003
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hokkaido, JAPAN
    Error showed.

    Thank you, rhenderson.

    However, while I was doing MAKE, it brought this error:

    Any idea?

    Thanks.
     
  12. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    If you can post full /.configure command you are using me or someone might be able to help.
     
  13. asiams

    asiams Well-Known Member

    Joined:
    May 28, 2003
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hokkaido, JAPAN
    Full ./configure

    Hi,

    Here is the full MAKE output in attachment.

    Thank you again.

    asiams
     

    Attached Files:

  14. cpane1

    cpane1 Well-Known Member

    Joined:
    Jun 10, 2007
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    I guess I might be late here, but those who are still looking for a solution for the pdo_mysql to work...... follow the steps as below....

    download and untar the installer pdo_mysql.
    cd /usr/src
    wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
    tar -xvzf PDO_MYSQL-1.0.2.tgz
    cd PDO_MYSQL-1.0.2
    phpize && ./configure && make && make install

    Do not forget to bookmark the path that is shown once the above command is completed. I got the below path after the above command was completed.

    /usr/local/lib/php/extensions/no-debug-non-zts-20060613

    now edit your php.ini file.

    pico /usr/local/lob/php.ini
    contrl w and search for: extension_dir and put the above path there.
    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"

    move down and put the extensions for pdo_mysql and pdo in the "dynamic extension" set

    extension=pdo.so
    extension=pdo_mysql.so

    save the file and exit.

    check if the module is loaded in php.ini.
    php -m
    pdo_mysql should show up now.

    also check with the phpinfo.php file
     
    #14 cpane1, Sep 13, 2007
    Last edited: Sep 13, 2007
  15. gtgeorge

    gtgeorge Well-Known Member

    Joined:
    Feb 28, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    This worked for us to get it installed with Apache 2.2 and php 5.2.4. It now shows up, but when a user is trying to use it they are receiving
    Code:
    [26-Sep-2007 19:29:36] PHP Warning: Module 'PDO' already loaded in Unknown on line 0
    [26-Sep-2007 19:29:36] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_pdo_mysql.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
    Is this a problem with the compile?
     
  16. cpane1

    cpane1 Well-Known Member

    Joined:
    Jun 10, 2007
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    hey,

    looking at the PHP warning message it seems that your PDO is already loaded.... and tries to double load and so the warning.....

    let me know what is your php.ini file has to say on the below line:

    extension_dir =

    Also let let me know what files are inside the "/usr/local/lib/php/extensions/no-debug-non-zts-20060613" directory...
     
  17. 1ONE

    1ONE Member

    Joined:
    Mar 18, 2004
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Croatia
    Thank you cpane1 !
     
  18. gtgeorge

    gtgeorge Well-Known Member

    Joined:
    Feb 28, 2007
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for the lead. I am not sure how it happened, but the entry was in there twice. :D It appears to be error free now.
     
  19. cpane1

    cpane1 Well-Known Member

    Joined:
    Jun 10, 2007
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    glade that I was of any use to use....

    :)
     
  20. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    This is a great thread, solve my problem.
     

Share This Page