问题
I recieved this error while installing Magento on a customer's server, 'PHP Extension "pdo_mysql" must be loaded'. How would one go about installing/enabling this extension through CPanel Accelerated?
Server information is as follows:
- cPanel Version 11.24.5-STABLE
- cPanel Build 38506
- Apache version 2.2.13 (Unix)
- PHP version 5.2.8
- MySQL version 5.0.81-community
- Architecture i686
- Operating system Linux
- Kernel version 2.6.18-128.1.6.el5
- cPanel Pro 1.0 (RC1)
Thanks!
回答1:
You can enable PDO in cPanel if you have cloudlinux installed. In cPanel search for PHP Version and on the resulting screen select and enable PDO and finally select save. * http://docs.cloudlinux.com/index.html?using_php_selector.html
If you do not have CloudLinux and PhpSelector installed you will need an administrator account to install PDO through easyapache. In WHM follow this guide:
Enabling PDO in Easyapache
- Log in to WHM ( http://domain.com/whm )
- Goto WHM »Software »EasyApache (Apache Update)
- Select "Previously Saved Config (** DEFAULT **)" and click "Start customizing based on profile"
- On the "Apache Version" page click "Next"
- On the "PHP Version" page click "Next"
- On the "Short Options List" page click"Exhaustive Options List"
- On the "Exhaustive Options List" ensure that PDO, PDO sqlite and PDO MySQL are selected.
- Then Click Build on the bottom of the page.
PS. I note that you are on 11.24.5-STABLE. This is a extremely old version of WHM/cPanel. You should update your server as this version of cPAnel is no longer supported by cPanel.
回答2:
I'm using Magento CE 1.7, CentOS 6, and WHM 11.38, and here's what I did to resolve the 'PHP Extension "pdo_mysql" must be loaded' error I received during my Magento install:
- Open WHM and go to Home » Software » Easy Apache (Apache Update)
- Scroll to the bottom and select "Start customizing based on profile"
- Click "Next step" twice
- Scroll to the bottom and select "Exhaustive Options List"
- Select checkboxes for PDO and PDO MySQL, and rebuild Apache
- Go to Magento's root, copy php.ini.sample to php.ini
Open the newly created php.ini file and add the following:
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
extension=pdo_mysql.so
This might be a good time to restart Apache using terminal (# service httpd restart). Hope that helps!
回答3:
I don't think you can do it in a shared host or with cPanel.
Convince the webhost to install it for you.
来源:https://stackoverflow.com/questions/1478201/installing-pdo-mysql-php-extension-on-cpanel