install both mysql and mysqlnd on ubuntu 12.04

前端 未结 2 1473
天涯浪人
天涯浪人 2020-12-11 03:19

I am having server at digital ocean and trying to run a custom php application. On my development machine: Mac OSX 10.7.5 PHP: 5.3.6 with mysql, mysqli, mysqlnd, pdo mysql

相关标签:
2条回答
  • 2020-12-11 03:53

    I believe the "current" way of doing this is to enable that PHP module after you install it, much the way you do with an Apache module: sudo php5enmod mysqlnd

    And then restart Apache for that module to load: sudo service apache2 restart

    That will create a symlink on /etc/php5/apache2/conf.d/ from /etc/php5/mods-available/ that Apache will pick up and load with priorities, like services during start-up. In my experience on Ubuntu 14 LTS it creates a symlink called 10-mysqlnd.ini from mysqlnd.ini.

    Here is a link for a more detailed explanation on the subject.

    0 讨论(0)
  • 2020-12-11 03:55

    You probably need to enable the mysqlnd extension. I ran into this problem recently (all references mysqli were broken after installing php5-mysqlnd), and fixed it by adding the following line to the bottom of my php.ini:

    extension=mysqlnd.so
    

    You can find the location of your php.ini in the output of phpinfo().

    Also note you'll need to restart your webserver for these changes to take effect.

    0 讨论(0)
提交回复
热议问题