cakephp logo

Cakephp - Parse error: syntax error, unexpected T_STRING

I was just trying out a Cakephp 1.3.x install with a vanilla Croogo CRM installation and got the following parse error when installing onto my MediaTemple hosting :-

Show Plain Text
PHP code
  1. Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR

This error relates to the PHP 4.X version not understanding the function declarations public, private and protected. What I had forgotten was the default fresh install under MediaTemple is PHP 4 for a new domain, don't ask me why but it is.

The simple solution is to put the following in the ../html/.htaccess file :-

Show Plain Text
Text code
  1. AddHandler php5-script .php
Filed under: Cakephp, Hosting  Tags: Mediatemple, Croogo

0 Responses to “Cakephp - Parse error: syntax error, unexpected T_STRING”

Sorry, comments have been closed for this post.
(default) 12 queries took 5 ms
NrQueryErrorAffectedNum. rowsTook (ms)
1DESCRIBE `posts`17171
2DESCRIBE `comments`11111
3DESCRIBE `tags`221
4DESCRIBE `categories`220
5DESCRIBE `posts_tags`221
6DESCRIBE `categories_posts`220
7SELECT `Post`.`id`, `Post`.`url`, `Post`.`title`, `Post`.`icon`, `Post`.`metadesc`, `Post`.`metakeys`, `Post`.`categories`, `Post`.`tease`, `Post`.`body`, `Post`.`private_body`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`allow_comments`, `Post`.`tags`, `Post`.`hitcount`, `Post`.`hitcount_rss` FROM `posts` AS `Post` WHERE `Post`.`url` = 'cakephp-parse-error-syntax-error-unexpected-t_string' LIMIT 1110
8SELECT `Comment`.`id`, `Comment`.`post_id`, `Comment`.`body`, `Comment`.`author`, `Comment`.`url`, `Comment`.`email`, `Comment`.`ip`, `Comment`.`status`, `Comment`.`junk_score`, `Comment`.`created`, `Comment`.`modified` FROM `comments` AS `Comment` WHERE `Comment`.`status` = 2 AND `Comment`.`post_id` = (76) 000
9SELECT `Tag`.`id`, `Tag`.`tag`, `PostsTag`.`post_id`, `PostsTag`.`tag_id` FROM `tags` AS `Tag` JOIN `posts_tags` AS `PostsTag` ON (`PostsTag`.`post_id` = 76 AND `PostsTag`.`tag_id` = `Tag`.`id`) 220
10SELECT `Category`.`id`, `Category`.`category`, `CategoriesPost`.`post_id`, `CategoriesPost`.`category_id` FROM `categories` AS `Category` JOIN `categories_posts` AS `CategoriesPost` ON (`CategoriesPost`.`post_id` = 76 AND `CategoriesPost`.`category_id` = `Category`.`id`) 220
11UPDATE `posts` AS `Post` SET `Post`.`hitcount` = Post.hitcount + 1 WHERE `Post`.`id` = 7610
12SELECT tag, COUNT(*) AS tag_cnt FROM posts_tags t2p INNER JOIN tags Tag ON t2p.tag_id = Tag.id GROUP BY tag49491