15 июл. 2011 г.

Drupal 7 - обновление модулей через админку

Был наслышан о автоматическом обновлении модулей в  drupal 7, но после попытки самому установить или обновить модуль через админку и получил ошибку "Your server does not support installing modules and themes from this interface. Instead, install modules and themes by uploading them directly to the server, as described in the handbook."

После недолгих исканий нашел решение проблеммы

I looked into my phpinfo() of the web server, and found that there was no FTP support. I recompiled PHP from source with this config option added:
"--enable-ftp"
(the whole line of the PHP config options that I used:

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-config-file-path=/etc' '--with-imap=/var/src/imap-2007e' '--with-gd' '--enable-mbstring' '--with-curl' '--with-mysql' '--with-pcre-regex=/usr/local' '--enable-pdo' '--with-pdo-mysql' '--with-zlib' '--enable-ftp'

) After that, I ran "make; make install" to get the "libphp5.so" for Apache HTTPd updated, and restarted the Apache web server. And that was it, the web interface for module installation worked.
Few things to note though:
1. I stopped the Apache server before PHP's "make install" was executed, to prevent an issue where "libphp5.so" can't be overwritten if it's in use.
2. the Drupal web site's "sites/all/modules" directory needs to be already created and owned by the Apache web server user to prevent errors such as:
Installation failed! See the log below for more information.

    * Error installing / updating
    * File Transfer failed, reason: Cannot chmod /var/www/drupal7/sites/all/modules/views.
3. Module dependency needs to be manually checked and installed.
(e.g. if installing Views , it's better to have Ctools installed first; otherwise, some error message flashed by (couldn't see clearly), even though it showed installation was successful)