Making CakePHP 2.0 work with OVH

I searched for a couple of hours et finally got it working by mixing two solutions, here are my .htaccess now (those files are located in the webroot, app and root folders) :

SetEnv PHP_VER 5_3

RewriteEngine On

RewriteBase /projets/videoclubkano

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

 

SetEnv PHP_VER 5_3

RewriteBase /projets/videoclubkano

RewriteEngine on

RewriteRule    ^$    webroot/    [L]

RewriteRule    (.*) webroot/$1    [L]

SetEnv PHP_VER 5_3

RewriteBase /projets/videoclubkano

RewriteEngine on

RewriteRule    ^$ app/webroot/    [L]

RewriteRule    (.*) app/webroot/$1 [L]

Here is the error I’ve got:

Missing Controller

Error: MycakeappController could not be found.

Error: Create the class MycakeappController below in file: app/Controller/MycakeappController.php

and the links generated by cake were invalid, for instance /projects/posts instead of  /projects/mycakeapp/posts.

4 thoughts on “Making CakePHP 2.0 work with OVH

  1. Merci, c’est exactement ce que je cherchais et ça marche du premier coup !
    Juste une petite suggestion, indiquer dans quel répertoire on trouve ces différents .htaccess (dans l’ordre webroot, app et racine).

    Encore merci !

  2. Bonjour,

    Il est donc possible d’utiliser cakePhp sur n’importe quel hébergement mutualisé de OVH ?

    Cette question est importante pour moi si quelqu’un a la réponse qu’il n’hésite pas à me contacter.

    • D’après mon expérience, oui. Cependant je n’ai testé qu’avec mon mutualisé (il en existe de plusieurs types?) et avec CakePHP d’il y a un an. Il y a peut être eu de nouvelles modifications depuis.

Leave a Reply to Caillou Cancel reply

Your email address will not be published. Required fields are marked *