1

Iv managed to install Drush to the site on Go Daddy shared hosting(thanks to the greate tutorial!). Simple commands run without any errors, but when I try:

drush pm-update ctools

It returns:

    -bash-3.2$ drush pm-update ctools
The external command could not be executed due to an application error.                                                                                                    [error]
                                                                                         [error]

<br />
<b>Parse error</b>:  syntax error, unexpected '{' in <b>/home/content/XXX/XXX/drush/includes/environment.inc</b> on line <b>518</b><br />
, code: <em class="placeholder">255</em>)
Update information last refreshed: Wed, 04/18/2012 - 06:11

Update status information on all installed and enabled Drupal projects:
 Name                                                   Installed version     Proposed version  Status
 Address Field (addressfield)                           7.x-1.0-beta2         7.x-1.0-beta2     Up to date
     Administration menu (admin_menu)                       7.x-3.0-rc1           7.x-3.0-rc1       Up to date

    ...

Security updates will be made to the following projects: Chaos tool suite (ctools) [ctools-7.x-1.x-dev]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n):

The code of the line 518 in environment.inc

is

517      try {
518      $db = new PDO($constr, $creds['user'], $creds['pass']);
519      $db = null;
520     }

Drupal is 7.12, Drush 5.1

What can be the reason of this error?

Also In hosting cotnrol panel site is on PHP 5.3 But php -v returns 5.2.17 is it ok?

5
  • If you press "y", what happens? Does it give you another error or does it update the modules? Even if it shows a parse error, as long as you can proceed by pressing y I wouldn't worry too much. Apr 19, 2012 at 15:05
  • I haven't tried to proceed further yet, as there are usually warnings that updates can harm the production site
    – ijujym
    Apr 19, 2012 at 15:18
  • The warnings are harmless, but you should always make sure you have a backup of your site whenever you do module updates. Apr 19, 2012 at 15:23
  • Yes its true, the site is backed up. But after the "y" the result is: File ctools-7.x-1.x-dev.tar.gz is corrupt (wrong md5 checksum). [error] Updating project ctools failed. Attempting to roll back to previously installed version. [error] Backups were restored successfully.
    – ijujym
    Apr 19, 2012 at 15:36
  • "In a shared hosting environment there may be some applications or modules that may not work due to the limitations and restrictions set on the shared environment. This may be the case with the module that you are trying to use. If you would like please reply back with the settings and configuration needed to run the module and we will see if it is compatible with the shared hosting plan you are on." GoDaddy support
    – ijujym
    Apr 23, 2012 at 20:53

2 Answers 2

1

This is a common issue in the Drush queue on drupal.org and the consensus is that its related to your version of PHP that runs in client mode versus the version running on your web server, ex. http://drupal.org/node/1402120 or http://drupal.org/node/436968. Of course, some of these were related to PHP 5 vs PHP 4 issues and you're just one version behind on the client but it may help to alias your php version as explained here:

echo 'export PATH="$HOME/packages/bin:$PATH"' > .bash_profile
mkdir -p packages/bin
ln -s /usr/local/php5/bin/php packages/bin/php

Patrick Kenny is right though that this parse error won't affect your upgrade in the end.

0

We had a similar problem on a machine. The reason was that the php running on cli did not have some extensions installed. In our case it were the extensions gd, xml and SimpleXML.

We solved that by installing the packages via apt-get install php5.6-gdand apt-get install php5.6-xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.