Answers.Body: <p>The syntax looks fine for me. You will need to check php version you are using. It should be 5.5 or more i believe. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-11T18:33:39.310Z
Answers.Text: Thanks, that was the problem, after updating to PHP 5.6 all is well.
Answers.UserDisplayName: Stephen Sloan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-11T18:34:13.390Z
Answers.Text: Wow... Cheers (y)
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-11T21:42:43.480Z
Answers.Text: Stephen - great that Pradeep helped you. Etiquette would be for you to 'accept' his answer as that helps guide others reading this
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-09T20:02:31.563Z
Answers.LastActivityDate: 2018-06-09T20:02:31.563Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>The main issue is already answered here, but check your php version and configuration against the requirements here: <a href="https://docs.civicrm.org/sysadmin/en/latest/requirements/#php" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/requirements/#php</a></p>
  
  <p>(Also, you might also want to check out 'clean-urls' in Drupal - <a href="https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls" rel="nofollow noreferrer">https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls</a>  That's not related to the cause of the problem but makes the URL's in your error message nicer)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-11T12:03:01.103Z
Answers.LastActivityDate: 2018-06-11T12:03:01.103Z
Answers.UserDisplayName: Aidan
Body: <p>So I successfully installed CiviCRM and most things are running well but I can't install extensions.</p>
  
  <p>From Gui
  I get to the "Download and Install button and the installation fails with:</p>
  
  <p><strong>WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP's open_basedir or safe_mode.
  Unable to extract the extension.
  Extension Upgrade Failed
  Download failed - ZIP file is unavailable or malformed</strong></p>
  
  <p>Manual
  I download and expand the zip file in the extensions directory
  It shows up as a local install
  When I click the "Install" button:</p>
  
  <p><strong>the browser shows an address of <em>(myserver)/drupal/index.php?q=civicrm/admin/extensions
  And the message is:
  This page isn’t working
  (myserver) is currently unable to handle this request.
  HTTP ERROR 500</em></strong></p>
  
  <p>I suspect some sort of PHP error but I don't know what the solution is.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-09T19:15:47.767Z
Comments.Text: So I've found part of the problem which deals with the manual install. It turns out the error was with one specific extension, the Mailchimp extension. In my server logs i found: "PHP Parse error:  syntax error, unexpected '[' in /home/e-smith/files/ibays/drupal/html/sites/default/files/civicrm/custom_ext/uk.co.vedaconsulting.mailchimp-2.0.1/mailchimp.php on line 318"
Comments.UserDisplayName: Stephen Sloan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-09T19:22:38.450Z
Comments.Text: Line 318 reads: " $js_safe_object = [ ];"  Other extensions install OK using the manual method.
Comments.UserDisplayName: Stephen Sloan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-09T22:53:13.587Z
Comments.Text: Per answer below - even though 4.6 still supports php 5.4 there is no expectation that extensions will run on 5.4
Comments.UserDisplayName: user4278
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-11T18:34:47.513Z
Comments.Text: Yes, PHP 5.6 solved the problem.
Comments.UserDisplayName: Stephen Sloan
Tags: <drupal><extension><installation>
Title: Can't install extensions on CiviCRM 4.6.36 with Drupal 7.59
ThreadText: # Can't install extensions on CiviCRM 4.6.36 with Drupal 7.59
  
  (Asked by: username_0 on 2018-06-09)
  
  So I successfully installed CiviCRM and most things are running well but I can't install extensions.
  
  From Gui
  I get to the "Download and Install button and the installation fails with:
  
  **WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP's open\_basedir or safe\_mode.
  Unable to extract the extension.
  Extension Upgrade Failed
  Download failed - ZIP file is unavailable or malformed**
  
  Manual
  I download and expand the zip file in the extensions directory
  It shows up as a local install
  When I click the "Install" button:
  
  **the browser shows an address of *(myserver)/drupal/index.php?q=civicrm/admin/extensions
  And the message is:
  This page isn’t working
  (myserver) is currently unable to handle this request.
  HTTP ERROR 500***
  
  I suspect some sort of PHP error but I don't know what the solution is.
  
  **Tags:** drupal, extension, installation
  
  > **Comments:**
  > **username_0**: So I've found part of the problem which deals with the manual install. It turns out the error was with one specific extension, the Mailchimp extension. In my server logs i found: "PHP Parse error:  syntax error, unexpected '[' in /home/e-smith/files/ibays/drupal/html/sites/default/files/civicrm/custom_ext/uk.co.vedaconsulting.mailchimp-2.0.1/mailchimp.php on line 318"  
  > **username_0**: Line 318 reads: " $js_safe_object = [ ];"  Other extensions install OK using the manual method.  
  > **username_1**: Per answer below - even though 4.6 still supports php 5.4 there is no expectation that extensions will run on 5.4  
  > **username_0**: Yes, PHP 5.6 solved the problem.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-06-09. Score: 2
  
  The syntax looks fine for me. You will need to check php version you are using. It should be 5.5 or more i believe.
  
  > **Comments:**
  > **username_0**: Thanks, that was the problem, after updating to PHP 5.6 all is well.  
  > **username_2**: Wow... Cheers (y)  
  > **username_3**: username_0 - great that username_2 helped you. Etiquette would be for you to 'accept' his answer as that helps guide others reading this  
  
  ---
  
  ### Answer by username_4 on 2018-06-11. Score: 2
  
  The main issue is already answered here, but check your php version and configuration against the requirements here: <https://docs.civicrm.org/sysadmin/en/latest/requirements/#php>
  
  (Also, you might also want to check out 'clean-urls' in Drupal - <https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls> That's not related to the cause of the problem but makes the URL's in your error message nicer)
  
  
  ---
  
  