Plugin

Archived
Forum
(read-only)

Jeremy Worboys does not actively monitor this forum
(but you can still get help from other EE users).

Simple MailChimp

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Jeremy Worboys

     

You must be logged in to post.

PHP Errors

Bug (Resolved)

Greg Wineman
Greg Wineman

Hello - I just added your basic example to a template with my API Key and List ID.

The Plugin tags don’t parse and I get the following PHP errors:

A PHP Error was encountered

Severity
Notice

Message
: Use of undefined constant __DIR__ assumed '__DIR__'

Filenamesimple_mailchimp/pi.simple_mailchimp.php

Line Number
352 
A PHP Error was encountered

Severity
Warning

Message
mkdir() [function.mkdir]No such file or directory

Filename
simple_mailchimp/pi.simple_mailchimp.php

Line Number
354 
A PHP Error was encountered

Severity
Warning

Message
file_put_contents(__DIR__/_cache/336b7ebadd5c46a730415c41eb5ec82f[function.file-put-contents]failed to open streamNo such file or directory

Filename
simple_mailchimp/pi.simple_mailchimp.php

Line Number
364 
A PHP Error was encountered

Severity
Warning

Message
Invalid argument supplied for foreach()

Filenamesimple_mailchimp/pi.simple_mailchimp.php

Line Number
68 
A PHP Error was encountered

Severity
Warning

Message
Invalid argument supplied for foreach()

Filenamesimple_mailchimp/pi.simple_mailchimp.php

Line Number
147 


Any thoughts?

Jeremy Worboys
# 1
Developer
Jeremy Worboys

Hey Greg,

This issue is related to the __DIR__ magic constant not being available in PHP 5.2.x. I have just uploaded Simple Mailchimp 1.5.3 which should address all errors with PHP 5.2.x.

Be sure to report any other issues you have.

Alex Stas
# 2
Alex Stas

Hello,

I just installed Version 1.5.3, and get these errors:

—————————————————————————————————————————————

A PHP ERROR WAS ENCOUNTERED

Severity: Warning

Message: mkdir(): Permission denied

Filename: simple_mailchimp/pi.simple_mailchimp.php

Line Number: 354

—————————————————————————————————————————————-

A PHP ERROR WAS ENCOUNTERED
Severity: Warning

Message: file_put_contents(/public_html/xxx/system/xxxxxxx/third_party/simple_mailchimp/_cache/47add7fxxxxxxxxxxxxxx): failed to open stream: No such file or directory

Filename: simple_mailchimp/pi.simple_mailchimp.php

Line Number: 364

—————————————————————————————————————————————-

A PHP ERROR WAS ENCOUNTERED

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /xxxx/public_html/xxx/system/codeigniter/system/core/Exceptions.php:170)

Filename: core/Common.php

Line Number: 408

Thank you for you assistance.

 

Jeremy Worboys
# 3
Developer
Jeremy Worboys

Hey Alex,

Looks like a permissions error. Simple Mailchimp creates a _cache directory in the third_party/simple_mailchimp directory to temporarily store the API lookup results. It seems the user PHP is running as doesn’t have permission to create this directory.

The best solution is to create the third_party/simple_mailchimp/_cache directory manually and allow the PHP user read/write permissions.