Configuring MySQL support for PHP

Discussion in 'PHP' started by sagar, Oct 29, 2008.

  1. sagar

    sagar New Member

    I migrated from Apache to Litespeed and all static content working fine. For PHP, I compiled 5.x version using litespeed webconsole. Now when I try to connect to mysql, I get following error:

    Code:
    This PHP environment doesn't have MySQL support built in. MySQL support is required if you want to use a MySQL database to run this forum. Consult the PHP documentation for further assistance.

    I checked wiki/installation and did some search on google but could not figure it out.

    I am a complete novice in all this, so would appreciate if some one could give me step by step instruction on how to setup mysql environment.
  2. mistwang

    mistwang LiteSpeed Staff

    Do you have a working PHP with Apache?
    Are you using a hosting control panel?
  3. sagar

    sagar New Member

    I had working PHP with Apache but I did this compilation thing thro' LS web console. I am using Parallel + LS no cpanel or any other standard CP
  4. anewday

    anewday Moderator

    Did you compile PHP with:

    --with-mysqli
  5. sagar

    sagar New Member

    I kept all default options as is
  6. anewday

    anewday Moderator

    Do you have WHM? If so, try compiling php from litespeed addon there. Click "build matching php binary"
  7. mistwang

    mistwang LiteSpeed Staff

    try a phpinfo() page under Apache PHP, if it show the compile configuration, use the same configuration to compile lsphp5 from web console.
    Otherwise, you have to find out what PHP module is enabled under Apache PHP and build a lsphp5 with similar configuration.
  8. sagar

    sagar New Member

    Can you help me with the values for mysql configuration?

    mysqli.default_host no value no value
    mysqli.default_port 3306 3306
    mysqli.default_pw no value no value
    mysqli.default_socket no value no value
    mysqli.default_user no value no value
    mysqli.max_links Unlimited Unlimited
    mysqli.reconnect Off Off
  9. mistwang

    mistwang LiteSpeed Staff

    mysql and mysqli are two different mysql module in PHP, they are not interchangeable. You have to build your PHP with configuration option
    "--with-mysql=<dir_to_libmysqlclient_installation>".

Share This Page