Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Core Labs / Archive / Force PHP5 in .htaccess

Make sure your server is running PHP 5

GHengeveld
#1 2010-02-28 00:55
Since Cotonti requires PHP 5, I found it convenient (or actually neccesary) to add a single line to my .htaccess file so the server (Mediatemple Grid Service) would treat my .php files as PHP 5.
If your server is executing files as PHP 4 you will soon find your site to die with a fatal error:
Call to undefined function: date_default_timezone_set()

Here's what I've added in .htaccess:
AddHandler php5-script .php

Perhaps we should include this in Cotonti by default.
pieter
#2 2010-02-28 00:58
Welcome back.
Or not?
... can we help you ...
GHengeveld
#3 2010-02-28 01:00
I'm still working with Cotonti for a big client project (hence the overpowered clustered gridservers). This is likely to become the largest Cotonti powered webservice.
Trustmaster
#4 2010-02-28 20:40
I'm not sure, this might be host-specific. I thought about adding a PHP version check to config.php as well as functions.php. Or a better solution is leaving the timezone config in config.php whereas the function itself is called in common.php.
May the Source be with you!