Cakephp css not working - cakephp-1.2

My cakephp is not loading any css,js. i uncommented the line Configure::write('App.baseUrl',env('SCRIPT_NAME')); in core.php.
and now get all the css and js but I get missing controllers. I have to
put index.php in the url.
eg:-http://localhost/myapp/index.php/login
i enabled the mod_rewrite but still its not working

If you are NOT using mod_rewrite, then you must:
A. Uncomment Configure::write('App.baseUrl', env('SCRIPT_NAME')); (which you said you've done)
B. Remove or disable your 3 .htaccess files (you haven't mentioned doing this...)
/.htaccess
/app/.htaccess
/app/webroot/.htaccess
Don't delete the files, just rename them to eg. .htaccessXXX so you can easily re-enable them later.
Also remember .htaccess are hidden files - so Google "how to show hidden files" if you can't already see them in your file browser.
C. You must include index.php in all your URLs. Eg. http://www.example.com/index.php/my_controller/my_action
Did you remember to do step 2 - disable your .htaccess files?
And remember that if you want to re-enable mod_rewrite again, then you must undo ALL the above three things, ie, comment out Configure::write('App.baseUrl', env('SCRIPT_NAME'));, enable all 3 .htaccess files, and no longer include /index.php in your URLs.
But the biggest question here is, are you really using Cakephp 1.2? This question has been tagged CakePHP 1.2 - but Version 2.1 is out now, so you should probably be using that.

Related

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 ...?

No css and images getting applied in cakephp 1.3 for iis

I am trying to use IIS for CakePHP 1.3 but no CSS and images are getting applied to it.
Make sure you have all .htaccess file in place.
Cakephp request is trying to get the css file from css folder but it is enable to have the proper path, .htaccess files in place to route it to the webroot and not to a controller!
Also check if mod_rewrite is enabled.
SEE HERE.

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.

Changing default install url path Bitnami Drupal 7 VM

In the bitnami default install of drupal 7 I want to change http://example.com/drupal to http://example.com/content
First attempt: modify $base_url in settings.php (/opt/bitnami/apps/drupal/htdocs/sites/default/)
This seemed to break the content at /drupal but did not change the location.
Second attempt: try editing the .htaccess file for everything (/opt/bitnami/apps/drupal/htdocs/). I added RewriteBase /content. Not sure but this didn't seem to change anything.
Third Attempt: try editing the .htaccess for the site (/opt/bitnami/apps/drupal/htdocs/sites/default/files) as described in this post:
How to remove /drupal from URL in Drupal 7 when installation is in the associated sub-directory
But I'm not even sure if I changed the example to the right thing. Deep down I don't believe that this many config lines are needed to change this.
I'm on bitnami-drupal-7.12-2-ubuntu-10.10.
You need to update the alias in the included apache conf file at /opt/bitnami/apps/drupal/conf/drupal.conf
If you look at the file, you'll notice that the alias is set to /drupal
Change this to /content

CakePHP 1.3.0 RC4 Installation

I have been using 1.2.6 and downloaded 1.3 to try it out. I am using wampserver with Apache 2.2.11. I have mod rewrite enabled. When I bake a new application using the cake 1.3 console, after I verify that the webroot/index.php of the application CAKE_CORE_INCLUDE_PATH is set to the Cake1.3 Installation folder. The result is a page thats missing CSS, missing a method. Typing in localhost/app/index.php will enable the program to find the app. Therefore I have to assume the rewrite module isnt functioning properly for v1.3. Is there something I have to add to the cake installation or app folder to make this function as it should?
No, Cake is set up properly from the start. The thing that always trips me up is that I forget to set my Apache virtual host's AllowOverride value to All. This allows the .htaccess file to be read.
Are there any error messages in your apache error logs?
Did you replace the previous application's directory with the new one? If not, you may need to add a tag with the appropriate AllowOverride permissions set inside your httpd.conf file, to allow mod rewrite to execute.
Can you load /css/style.css in your browser or does it give a 404?
This may sound like a silly question, but after you made your changes to AllowOverride in your Apache configuration, did you restart Apache?

Resources