Title: Fatal error: Cannot use string offset as an array in&#8230;.
Last modified: August 21, 2016

---

# Fatal error: Cannot use string offset as an array in….

 *  [freshjustin](https://wordpress.org/support/users/freshjustin/)
 * (@freshjustin)
 * [13 years ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-in-1/)
 * Hi there,
 * I have been using this plugin for almost 1.5 years but after the most recent 
   update it said that there was an error and i need to re-activate. After doing
   so I now cannot re-activate and it give mes the following error. Can you help
   me?
 * Plugin could not be activated because it triggered a fatal error.
    Fatal error:
   Cannot use string offset as an array in /public_html/wp-content/plugins/google-
   document-embedder/libs/lib-setup.php on line 38
 * [http://wordpress.org/extend/plugins/google-document-embedder/](http://wordpress.org/extend/plugins/google-document-embedder/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [k3davis](https://wordpress.org/support/users/k3davis/)
 * (@k3davis)
 * [13 years ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-in-1/#post-3712242)
 * I’ve not seen that error before, but best I can tell it’s particular to PHP 5.3?
   It’s a weird one that looks like it doesn’t occur in other versions (including
   5.4).
 * I can suggest an edit to the lib-setup.php file but I’m not sure if it will resolve
   the issue or not, since I can’t reproduce this. If you’re comfortable doing so,
   try replacing this block of code very near the top:
 *     ```
       function gde_defaults( $type ) {
       	global $env;
   
       	// gather/set environment info
       	if ( ! $env ) {
       		$env['pdata'] = gde_get_plugin_data();
       		$env['baseurl'] = gde_base_url();
       		$env['default_lang'] = gde_get_locale();
       		$env['apikey'] = gde_get_api_key( $env['pdata']['Version'] );
       	}
       ```
   
 * with this block of code in the same location:
 *     ```
       function gde_defaults( $type ) {
       	global $env;
   
       	// gather/set environment info
       	if ( ! $env ) {
       		$pdata = gde_get_plugin_data();
       		$baseurl = gde_base_url();
       		$default_lang = gde_get_locale();
       		$apikey = gde_get_api_key( $env['pdata']['Version'] );
       		$env = array (
       			'pdata'				=>	$pdata,
       			'baseurl'			=>	$baseurl,
       			'default_lang'			=>	$default_lang,
       			'apikey'			=>	$apikey
       		);
       	}
       ```
   
 * Let me know if you need help doing this or what the results are, if you would.
   Thanks.
 *  Thread Starter [freshjustin](https://wordpress.org/support/users/freshjustin/)
 * (@freshjustin)
 * [13 years ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-in-1/#post-3712243)
 * Great, I will try this and post my results. Thanks
 *  Thread Starter [freshjustin](https://wordpress.org/support/users/freshjustin/)
 * (@freshjustin)
 * [13 years ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-in-1/#post-3712320)
 * Hi k3davis,
 * I did what you said exactly and am still getting errors. Here is the new error:
 * Plugin could not be activated because it triggered a fatal error.
 * Fatal error: Cannot use string offset as an array in /public_html/wp-content/
   plugins/google-document-embedder/libs/lib-setup.php on line 72
 * Any other suggestions?
 * I can provide you ftp access if it would be easier.
 *  [k3davis](https://wordpress.org/support/users/k3davis/)
 * (@k3davis)
 * [13 years ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-in-1/#post-3712334)
 * You must have a fairly unique PHP configuration? Strange to see such problems
   once (or at most, twice) out of 250 downloads per day…
 * With the above code applied line 72 does not contain any code that would prompt
   any sort of error:
 * `"link_pos" => 'below',`
 * If your line 72 differs, I wonder if the code above is correctly applied? Or 
   perhaps you have something commented out and your line numbers are different?
 * You can email me at the address found in the GPL statement in gviewer.php if 
   you want to work more directly on the issue with me. I’m sorry you’ve run into
   such problems, but as I said, very odd that you’re getting them and no other 
   such reports.
 * Kevin

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal error: Cannot use string offset as an array in….’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-document-embedder_484848.svg)
 * [Google Doc Embedder](https://wordpress.org/plugins/google-document-embedder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-document-embedder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-document-embedder/)
 * [Active Topics](https://wordpress.org/support/plugin/google-document-embedder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-document-embedder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-document-embedder/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [offset](https://wordpress.org/support/topic-tag/offset/)

 * 4 replies
 * 2 participants
 * Last reply from: [k3davis](https://wordpress.org/support/users/k3davis/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-in-1/#post-3712334)
 * Status: not resolved