After updating to latest .dev I got;

Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in _zurb_foundation_load() (line 20 of /sites/all/themes/zurb-foundation/template.php).

greetings, Martijn

Members fund testing for the Drupal project. Drupal Association Learn more


chrisjlee’s picture

@Martijn: Are you using php 5.2 ?

Summit’s picture

Yes I am using PHP 5.2.4

Greetings, Martijn

chrisjlee’s picture

Status: Active » Needs review


Thanks for reporting this. I went ahead and committed a fix. Let me know if solves your issue by performing an update to the latest version. I'm pretty confident it will.


FYI: For those who are googling this issue; __DIR__ is a magic constant only supported in php 5.3 +.

r4dian’s picture

The workaround didn't work for me but manual replacement of "__DIR__" to "__FILE__" did the trick. Thanks.

chrisjlee’s picture

Assigned: Unassigned » chrisjlee

Thanks. work on find another solution.

chrisjlee’s picture

Status: Needs review » Needs work


jedihe’s picture

According to the PHP documentation, defined() and define() take a string for the constant; I'm attaching a patch to fix that.

jedihe’s picture

Attaching file missing on previous comment.

Summit’s picture

Hi, #8 worked for me on PHP 5.2.4 !
greetings, Martijn

ishmael-sanchez’s picture

For the record, based on http://drupal.org/requirements 5.3 is recommended and some modules require 5.3 so I don't think it's unreasonable to have a theme require 5.3 and Drupal 8 will require 5.3.

July 22 2010 per http://www.php.net/archive/2010.php#id2010-07-22-1

This release marks the end of the active support for PHP 5.2. Following this release the PHP 5.2 series will receive no further active bug maintenance. Security fixes for PHP 5.2 might be published on a case by cases basis. All users of PHP 5.2 are encouraged to upgrade to PHP 5.3.

chrisjlee’s picture

Status: Needs work » Closed (won't fix)
559 bytes

I went ahead and actually removed the work around. Commit: http://drupalcode.org/project/zurb-foundation.git/commit/3d7b46c

For those who want to continue to use the zurb theme but are still using php 5.2, attached is a rerolled patch.

Thanks @jedihe for the patch.

I also updated the project page to inform of the requirements and the patch that is available for the time being.

dylanthomas’s picture

Weird occurrence for me, my fault, I set the PHP version back and removed a php.ini file from the root thinking it wasn't needed - turns out I was wrong, a few hours later.... I tried uninstalling and reinstalling twice, I was getting this exact error - using 1&1 shared hosting - turns out Global PHP settings to 5.4 was the 1st step to fixing this, the 2nd was setting Local PHP settings to 5.4 (New Local PHP Version) and apply it to the root directory, no error no more.

chrisjlee’s picture

Thanks for your helpful report DylanThomas!

dylanthomas’s picture

Too much coffee if I recall!

alexweber’s picture

Status: Closed (won't fix) » Closed (duplicate)

This actually got committed a while ago: #2001046: Don't require PHP 5.3

Marking as duplicate.