简体   繁体   中英

How to enable php extensions and database support?

After spending some time in setting up a local sever in mac os, installing php5, and finally installing mysql I am still running on problems when trying to perform an drupal install.

When going to install.php the page shows the following

PHP extensions Disabled

Drupal requires you to enable the PHP extensions in the following list (see the system
requirements page for more information): gd

And;

Database support Disabled.

Your web server does not appear to support any common PDO database extensions. Check with
your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases
that Drupal supports.

Any ideas on how to proceed with the installation?

More information:

php5 and php5-gd were installed via macports. mysql was installed via homebrew.

You need two more packages to pass through this error message:

php5-gd and php5-mysql .

So just install it and you'll not get any error.

Note: You can replace php5-mysql to other package based on the database you are using.

For example:

php5-sqlite for sqlite
php5-pgsql for postgres
php5-adodb for ADOdb database

I ran into this issue as well when trying to manually setup drupal, apache, mysql and php on windows, even after uncommenting extension=php_gd2.dll, extension=php_mbstring.dll and extension=php_pdo_mysql.dll from the Dynamic Extensions section

In order to fix this, I had to change the extension_dir in my php.ini to explicitly state the folder path of the extensions:

From:

extension_dir = "./ext"

To:

extension_dir = "C:/php/php-5.3.28-Win32-VC9-x86/ext"

Error:PHP extensions disabled: gd

Install php-gd package. Post installing if the error persists, un-comment the following line in /etc/php/php.ini

extension=gd.so

Worked for me!

In php.ini I added

extension_dir = "C:\\xampp\\php\\ext"

And uncommented

extension=pdo_mysql extension=gd2

Looks like your build of php5 doesn't enable gd and pdo-mysql as default, so what you need to do is re-configure your php5 with two extra config:

--with-pdo-mysql=mysqlnd
--with-gd

and then 'make&&sudo make install'

为什么不从http://www.apachefriends.org/en/xampp-macosx.html安装已预构建 Apache、PHP5、MySQL 的 XAMPP?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM