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.

[Case 75541] PDO/PDO MySQL/sqlite3 not working under Apache 2.4.6 + PHP 5.2.17

Discussion in 'EasyApache' started by Kent Brockman, Aug 28, 2013.

  1. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello guys. I want to share what I found last night and lookup if anyone else can reproduce this.
    I have one server which HAVE TO be kept with PHP 5.2.17 because of its legacy script and old handmade websites. Its configured to run with less amount of required PHP extensions posible so it's very lightweight. Then, one of these sites needed to implement Magento, which forcefully require PDO MySQL for the queries. Everything was running fine until I decided to give Apache 2.4.6 a try. I've already deployed 2.4.6 in other servers with PHP 5.4 and everything worked smoothly. But not under PHP 5.2.17. This server run CentOS 6.4 64bits. So I decided to compile another server with CentOS 5.9 x86, PHP 5.2.17 and Apache 2.4.6 and guess what: PDO is not loading neither.

    The extension_dir in both servers is:
    /usr/local/lib/php/extensions/no-debug-zts-20060613

    And the extensions are physically present and being called from PHP:
    xcache.so, pdo.so, pdo_sqlite.so, sqlite.so, pdo_mysql.so

    When you run a phpinfo() you can see
    Code:
    Configure Command:
    './configure' '--enable-bcmath' '--enable-exif' '--enable-fastcgi' '--enable-force-cgi-redirect' '--enable-ftp' 
    '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' [B][COLOR="#FF0000"]'--enable-pdo=shared'[/COLOR][/B] 
    '--enable-sockets' '--enable-zend-multibyte' '--enable-zip' '--prefix=/usr' '--with-bz2' '--with-curl=/opt/curlssl/' 
    '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' 
    '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' 
    '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/'
    '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' 
    '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' [B][COLOR="#FF0000"]'--with-pdo-mysql=shared' 
    '--with-pdo-sqlite=shared'[/COLOR][/B] '--with-png-dir=/usr' [B][COLOR="#FF0000"]'--with-sqlite=shared'[/COLOR][/B] '--with-ttf' '--with-xpm-dir=/usr' 
    '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'
    
    But if you scroll down, those highlighted extensions won't be shown. And in fact, are not being loaded.

    BTW, I can confirm those extensions work well in other servers with these configs:
    PHP 5.4.19 + Apache 2.4.6
    PHP 5.4.19 + Apache 2.2.25
    PHP 5.2.17 + Apache 2.2.25

    The problem seems to be when you mix PHP 5.2 + Apache 2.4.

    Can anybody tell if there is any known incompatibility? No workaround available? Should I stick to Apache 2.2 if PHP 5.2 is a mission critical factor?

    I have opened a ticket (4330691) but I wanted to share this with the community too since I don't find info in other forums.

    Thank you
     
    #1 Kent Brockman, Aug 28, 2013
    Last edited: Aug 28, 2013
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    There is an internal case open regarding the use of Apache 2.4 in conjunction with PHP 5.2. The issue is that ZTS rather than non-ZTS modules are compiled and used. Per the ticket you opened, this issue you have reported is related to this internal case. For reference, the case number is 75541. There is currently no time frame available on if/when a solution may be implemented. Note that PHP 5.2 is EOL. It's scheduled for removal from EasyApache at the end of 2013.

    Thank you.
     
  3. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Yep, I know it's deprecated, and as you know, there are thousands of servers out there with legacy scripts which probably won't be able to be upgraded before end of 2013. As PHP 5.2 will still be available in cPanel as an addon, it is probably a good idea if you find a solution to allow the use of a better Apache version.

    Otherwise, Easy Apache should alert the user when PHP 5.2 and Apache 2.4 are selected, warn that it is a bad combination and suggest to stick to the old Apache version, rather than allow the sysadmin to discover the incompatibility the hard way. :)

    If the internal case may be solved would be just great. But given the current goals at cPanel I don't think this issue will have enough priority :(
     
Loading...
Similar Threads - [Case 75541] PDO
  1. guldvog
    Replies:
    10
    Views:
    1,676

Share This Page