Posts

Showing posts with the label drupal

Class 'DOMDocument' not found error in Drupal 7

Thought of trying out Drupal 7 after a long time, as much as I had used Drupal 6, I was expecting Drupal 7 to work out of the box for a system which was previously running Drupal 6.I noticed that, for some reason, there were these error messages in my httpd logs: [Wed Jul 25 17:40:13 2012] [error] [client 127.0.0.1] PHP Fatal error:  Class 'DOMDocument' not found in /home/ausmarton/Public/website/drupal-7.7/modules/filter/filter.module on line 1041 Now, since I had worked quite a bit with version 6, I knew that all that needs to be done was this: yum install php-xml and /sbin/service httpd reload  And it did work! Well, so it looks like besides the usual php extensions like php-gd, php-mysql and others, Drupal 7 also needs php-xml to be able to work properly. EDIT: I've tried this with PHP 5.3.11 on Apache 2.2.21.

Apache forbidden by SELinux and access permissions

This post is a very trivial one, but it's just that I've found myself ignoring these things time and again. Every time I need to setup a new system for development in PHP or Drupal, I've ran into almost all of these small "issues". I would always prefer to have the working copy of the code somewhere in my home directory , and maybe have it symlinked from the directory which is set as my "Document Root" in Apache. # cd /var/www/html # ln -s ~ausmarton/Public/website/drupal-7.7 drupal Assuming, everything is set up and will work, I go ahead to access the application in my browser, just to find out that all I can get is a big "Forbidden"  message. Now, this happens because, in linux, to be able to access the contents of a directory, you should have the 'x' permission. But, unfortunately, home directories are by default set not to be accessible by anyone other than the designated user. drwx------. 37 ausmarton ausmarton  4096 Aug 25 17:08 a...

Drupal 6 db_create_table cannot handle primary/unique keys

The Drupal API provides a function called db_create_table which allows you to create a table in your database. If you need to add a table for a module, after the module is installed, then you could use this function in your update hook. The documentation of db_create_table says that it accepts three arguments, an array which will contain the query result, the name of the table and an array containing the schema definition of the table. The schema definition has to be in the structure defined by the Drupal Schema API . What I recently noticed was, that db_create_table does not seem to accept primary/unique keys in the schema definition. It seems like you need to first create a table without any constraints. For this, you'll have to provide db_create_table with an array containing the schema without any key constraints. After doing that, you can use db_add_primary_key in order to create a primary key. Similarly, there is a function to create a unique key constraint - db_add_uniq...