cividesk / com.cividesk.email.sparkpost

This extension allows CiviCRM to send emails and process bounces through the SparkPost service.
10 stars 30 forks source link

Error when using incorrect PHP version #12

Closed axon-obriend closed 8 years ago

axon-obriend commented 8 years ago

I'm including this for reference only. The default PHP version for some hosting providers may not meet the minimum requirement for the extensio and you may get the following error:

Fatal error: Can't use function return value in write context in /home/customer/websites/customer.org/htdocs/sites/default/files/civicrm/extensions/com.cividesk.email.sparkpost/CRM/Admin/Form/Setting/Sparkpost.php on line 128

The extension's README does indicate that PHP 5.4 or higher is a prerequisite, but particularly for CiviCRM 4.4 users, where PHP 5.3 was acceptable (there's a deprecation warning for CiviCRM 4.6) this might be missed. I resolved this on Siteground with the following line in the .htaccess file AddHandler application/x-httpd-php56 .php .php5 .php4 .php3

nganivet commented 8 years ago

Axon - there are other things in the extension that will not work if PHP is less than 5.4, including any calls to SparkPost itself. I have added dependency checks so that you are warned during install and configuration if your server does not meet the requirements.