Fixing the magic_quotes error when installing Drupal 8

manually installing Drupal 8, you may run across a common error after uploading the files. This error is in regrds to the magic_quotes settings of your server. If they are incorrect you will see an error message like this


PHP’s ‘magic_quotes_gpc’ and ‘magic_quotes_runtime’ settings are not supported and must be disabled.

What does this error mean?

Don’t be alarmed. The error simply means that there are a couple of settings named magic_quotes_gpc and magic_quotes_runtime that need to be set to Off in order for the Drupal 8 Install program to run. These settings are located in your php.ini file and are easily disabled by following the instructions below.

How to turn off the magic_quotes settings in php.ini

  1. Login to your cpanel
  2. Once in the main cPanel area, look for the Files category and click on the File Manager. Once inside, locate the php.ini file. This is generally located in the public_html folder.
  3. USING FILE MANAGER : open the file and look for the settings for magic_quotes_gpc and magic_quotes_runtime. Ensure they are set to Off. Additionally, ensure there is no semicolon (;) at the beginning of the line of code for the settings.

    Before; magic_quotes_gpc On
    ; magic_quotes_runtime Off

    Aftermagic_quotes_gpc Off
    magic_quotes_runtime Off

  4. After adjusting the settings appropriately, click on the Save Changes button in the upper right corner to save the new settings.

You should now be able to continue with installing Drupal 8 without issue by re-visiting your website. The error should now have disappeared.

On Feb 2, 2017 1:36 AM, "Rajveer singh" <rajveer.gang> wrote:

taxonomy_get_parents() returns all the parent terms for the taxonomy term with the ID passed as argument.
The value returned from the function is an array having the following structure:

array( 'term id' => [taxonomy term object] ) 

The taxonomy term object contains a property for each of the fields contained in the "term_data" table.

The code used from the function is essentially the following one.

$result = db_query(db_rewrite_sql('SELECT t.tid, t.* FROM {term_data} t INNER JOIN {term_hierarchy} h ON h.parent = t.tid WHERE h.tid = %d ORDER BY weight, name', 't', 'tid'), $tid); $parents = array(); while ($parent = db_fetch_object($result)) { $parents[$parent->$key] = $parent; }

As you see, it doesn’t return the parent terms of the parent terms of the one passed as argument. For that you need taxonomy_get_parents_all(), which executes the following code.

 if ($tid) { $parents[] = taxonomy_get_term($tid); $n = 0; while ($parent = taxonomy_get_parents($parents[$n]->tid)) { $parents = array_merge($parents, $parent); $n++; } }

The function returns all the parent terms in the hierarchy.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Up ↑

%d bloggers like this: