1
votes

My client has asked for a cake php app i've made for them to go into a sub directory on their existing server. All works perfectly on my test remote and local installations.

Initially I had a problem with htaccess and had to add RewriteBase /quotesystem/ to my htaccess files in order to see the site at all. So I have changed my htaccess as below:

cake root .htaccess:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteBase /quotesystem/
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

app .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine on
RewriteBase /quotesystem/app/
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

and webroot .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
RewriteBase /quotesystem/app/webroot/
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>

Now I can access my site but i get loads of warnings about the temp directory:

Warning (2): SplFileInfo::openFile(/web/sites/_p/_e/_t/petersen-stainless.co.uk/public/www/quotesystem/app/tmp/cache/persistent/cake_core_cake_en-gb) [function.SplFileInfo-openFile]: failed to open stream: No such file or directory [CORE/Cake/Cache/Engine/FileEngine.php, line 295]

You can see it here: http://www.petersen-stainless.co.uk/quotesystem

Now, i've CHMOD the temp directory to 777 so everyone should have permissions but i still get these errors.

I've deleted all of the files in these folders so that the temp directories have been cleaned.

When I use my ftp client - transmit - to look at the file permissions the owner appears as (?) and if i try to change it i get an error: Could not change owner of “tmp”. Server said: 'SITE CHOWN' not understood

I dont get this with any other site I work on.

I don't understand enough to know what is going on, is this a permissions problem or an .htaccess problem or both? Or is it a server configuration problem?

If anyone can help shed some light on this and help my understanding i'd be very grateful.

UPDATE: My directory structure on the server is as follows:

-- public

--- www

----- quotesystem

------- lib

------- app

--------- config

--------- webroot

2

2 Answers

2
votes

In my experience, the SplFileInfo warning appears when Cake attempts to read/write cache that it does not have permission to access. Make sure your application has permission to read/write the cache/tmp folder (depending on your Cake version).

0
votes

It's probably a .htaccess problem. The RewriteBase should be the same for both the webroot and app .htaccess. So the line in both files should be:

RewriteBase /quotesystem/

I personally never touch the .htaccess in the Cake root directory as it doesn't seem to be necessary to alter anything there.

In addition, /tmp/cache and it's subdirectories should be writable as well.