A word of warning to users of 1and1 and cakePHP
Posted by Duncan | Posted in cakePHP, Yahoo! UI | Posted on 30-05-2010
Tags: 1and1, PHP 5
4
Something I found out recently when I updated the cakePHP core files, when accessing my 1and1 hosting using ssh I kept getting errors when using the cakePHP console. The problem was caused by the fact that by default 1and1 uses PHP 4 for the command line. This cannot be altered using .htaccess, however after a little googleing I found that using php5 on the command line does as you would expect. So to make your cakePHP console work using PHP 5, all that is needed is a little editing of one file. CORE/console/cake
Change this:
exec php -q ${LIB}cake.php -working "${APP}" "$@"
To this:
exec php5 -q ${LIB}cake.php -working "${APP}" "$@"
All console actions will then be run using PHP 5.



Another hint is to include the following lines in your apps top level .htaccess if you want your 1and1 server to allow you to use php5 commands.
Change ‘/.htaccess’ to:
AddType x-mapp-php4 .php
AddType x-mapp-php5 .php
SetEnv PHP_VER
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
P.S. I came across the above issue and fix after uploading a CakePHP app that was working fine on my server to a client’s 1and1 server and my use of ClassRegistry::init() began throwing errors.
1and1 has new panel and you can switch on and off with one click right now
Please add
RewriteBase /
in your .htaccess file and issue will be resolved.