CakePHP home page - cache not working - cakephp

In my CakePHP home page, I get the message:
Your cache is NOT working. Please check the settings in APP/config/core.php
I googled for possible solutions, some of which were to uncomment the Cache.check and Cache.disable line. Even then the error isn't resolved.
Also the webserver runs on www-data (exec('whoami');) whereas my home folder is public_html. How do I change www-data to public_html?

Besides, check if you have the original directory structure inside /app/tmp/cache.
Recently I had the same problem, and found out that for some reason my /app/tmp was empty. Redoing the directory structure helped.

Assuming your cache is set to file, make sure your /app/tmp and all the folders inside are world-writable (drwxrwxrwx).

Related

Joomla 3x Homepage 404 & configuration file error

I've started getting a 404 error on my homepage, yet I can still access the admin area.
Another issue I'm having (which I'm guessing is related) is that I cannot save any changes to the 'Global configuration' page and I get this message when I click save:
'An error has occurred.
0 Could not write to the configuration file'
The configuration.php file permission is set to 0644
This is the website URL: http://www.asgdesign.eu
Any help would be appreciated!
Thanks
1. htaccess
Check the .htaccess file, if you have one in the root folder of your website. If there are no obvious issues, try backing up .htaccess and copying the default htaccess.txt file to .htaccess to see if this helps.
2. SEF
Temporarily disable any third party SEF extensions that are installed.
3. Cache
Try clearing and purging the cache to ensure you are viewing the latest version of the website.

Debug CakePhp Step by step

My client want the code I've did in a subfolder.
I've put everything inside but I have only a blank page.
When I try to use phpinfo in the index file, nothing appears.
On the app/core.php the same
I don't have access to root to test if it's an issue with the root .htaccess or with my script.
Which cakephp file should be called first if the subdomain setup is good?
Thanks.
EDIT:
Ok I know what's wrong. SetEnv PHP_VER 5_3 does not work on the shared
hosting where my client have his main website. The client does not
want to upgrade the php version and this directive in the .htaccess
seems to be ignored. What alternatives do I have ...?

CakePHP without mod_rewrite causes 404 errors

I'm pretty new to Cake, so I tryed to start with the blog tutorial.
I installed CakePHP 2.3.8 in webroot.
Configured SQL and deleted all 3 .htaccess-files, cause i have no mod_rewrite. In core.php I activated
Configure::write('App.baseUrl', env('SCRIPT_NAME'));
I created the Posts-Model, Controller and the index-View like the tutorial says.
The APP/View/Pages/home.ctp tells me, everything's allright.
But when i try to open /posts/index i get a 404. Why?
Without mod_rewrite the urls look like www.example.com/index.php/controllername/actionname/param, i.e. in your example you have to call /index.php/posts/index (or /index.php/posts/).

URL rewriting is not properly configured on your server

I tried upgrading my cakephp version from 1.3 to 2.5 but encountered an url rewriting problem. Another cakephp app runs on the same version so I'm sure the mod_rewrite works.
Although when I go to example.com/pages/home I get following error:
URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting
When I go to my normal home page and I want to click on a home link I get following url :
http://example.com/app/webroot/index.php/
And it is the same for other urls.
http://example.com/antwerp becomes http://example.com/app/webroot/index.php/antwerp
When I go to http://example.com/antwerp the site works as it should...
Any ideas where I've gone wrong?
I would suggest accessing your account and re-uploading your .htaccess files from and to the following locations respectivelly.
/app
.htaccess
/webroot
.htaccess
.htaccess
Some FTPs do not upload those files automatically until you force it to.
If that does not work, check if you have your php.ini file in your public_html folder of this application.

Cakephp 2.1 White Screen on Devserver

We created a subdomain on our server. First we tested that HTML worked, then I did phpinfo() and everything worked fine there. But when I moved the entire Cakephp app to the devserver at:
dev.lessonshark.com
I get a white screen. But I can go to:
dev.lessonshark.com/css/front.css
and that routes fine.
What I have done so far:
1. Made debug in core set to 3.
2. Removed all the cache files in tmp folder.
Still no luck, any ideas?
Firstly, check your server error logs. White screens are usually one of the following:
You didn't clear out the files in /app/tmp/cache (leave the
directories, remove any files).
You are running out of memory (check the server logs)
mod_rewrite is not enabled on the server or is not configured correctly (check you have allowOverride all set in your apache config so Cake's .htaccess files are read)
[edit]
you haven't made your app/tmp directory writable by the web user
I just cracked my head with this problem.
If none of the above mentioned solution work, (debug, emptying cache..etc), try this one.
Open up your controller, remove any unwanted empty line especially at the top of the file anywhere around you <?php tag, and make sure no useless empty line around the closing ?> tag as well.
I hope it help.

Resources