Tuesday Feb 19, 2008

Drupal 6 on OpenSolaris Webstack

Whilst installing Drupal 6.0 on Solaris Express Developer Edition (SXDE) 1/08 I ran into a few glitches with the brand new Webstack, which makes it's debut in this build of OpenSolaris.  (SXDE is Sun's distro of OpenSolaris.  It's the best way to get access to all the latest stuff in a relatively feature complete distro of OpenSolaris without having to build the whole O/S yourself.)  With the advent of Webstack integration you don't need a separate download to get all the AMP stack integration and optimizations previously only available in Coolstack.

The executive summary of the solution to the Drupal 6.0 install glitches is:

  1. Edit  /etc/php5/5.2.4/php.ini  to add '.' and Drupal's base dir (/opt/drupal-6.0, in my case) to PHP's include_path:
    include_path = ".:/usr/php5/5.2.4/include/php:/opt/drupal-6.0"  
  2. Spoof PHP into thinking it's using an older MySQL client:
    ln -sf /usr/mysql/5.0/lib/mysql/libmysqlclient.so.15 \\ 
    /usr/mysql/5.0/lib/mysql/libmysqlclient.so.12

    Now, with these fixes in place, I have the advantages of the Service Management Framework (SMF) and DTrace, plus an AMP stack compiled with optimizations for Solaris and the processor architecture (AMD64, in my case). 

    If you're interested in a more detailed account of the glitches and fixes, read on...


    The first glitch prevented the Drupal index.php page from rendering, and appeared in the apache error_log as:

    PHP Warning:  include_once() [<a href='function.include'>function.include</a>]: Failed opening 
    'includes/install.inc' for inclusion (include_path='/usr/php5/5.2.4/include/php'

    which was remedied by adding '.' to the include path in include_path in /etc/php5/5.2.4/php.ini

    include_path = ".:/usr/php5/5.2.4/include/php" 

    Then, proceeding to the database setup, MySQL gave an error:

    "Client does not support authentication protocol requested"

    This was easily resolved by the procedure posted on http://dev.mysql.com/doc/refman/5.0/en/old-client.html, but that's a compromise on MySQL password strength, so not ideal.   This allowed me to proceed to the next glitch, which apache error_log explained as:

    "ld.so.1: httpd: fatal: relocation error: file 
    /usr/php5/5.2.4/modules/mysqli.so: symbol
    mysql_set_local_infile_handler: referenced symbol not found"
    After much hair pulling, Sriram pointed me to the solution he worked out for the same problem with MediaWiki installation:
    ln -sf /usr/mysql/5.0/lib/mysql/libmysqlclient.so.15 \\
    /usr/mysql/5.0/lib/mysql/libmysqlclient.so.12

    and another addition to include_path in /etc/php5/5.2.4/php.ini to add Drupal's base dir

    include_path = ".:/usr/php5/5.2.4/include/php:/opt/drupal-6.0" 

    Turns out that spoofing the library name like this also solved the "Client does not support authentication protocol ..." problem too, so I'm back to full MySQL password strength.

    After these three simple but obscure fixes it was all clean sailing.  I now have Drupal running in six zones across two separate instances of SXDE 1/08 using the latest Webstack. 

    About

    At the confluence of cloud computing, sustainability, and open source

    Search

    Archives
    « April 2014
    SunMonTueWedThuFriSat
      
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
       
           
    Today