all css files and image are not loading in cakephp - cakephp

Why all css files and images are not getting loaded in cakephp. Although i've written code like this in my default.ctp
echo $html->css('generic');
Please help me in this issue..
css files are placed in app\webroot\css

You have to copy the .htaccess file into your htdocs/yourcakeproject/ directory.
If you're running your Cake application on an Apache webserver you have to make sure that the module mod_rewrite is installed.
If you use Lighttpd as your webserver, there is a chapter in the CakeBook how you have to configure Lighttpd: Pretty-URLs-and-Lighttpd.

Try this changes.In Apache config File
1.LoadModule rewrite_module modules/mod_rewrite.so
(Enable This Line) by removing #.Next Step is
2.Replace This Code “AllowOverride None” By “AllowOverride All”.

Related

cakephp access cs and js files inside webroot folders

I am getting a problem in deploying my app to the server. The problem is i have folders inside the webroot which points to the .css and .js files.
I was doing the basic cakephp function $this->Html->css('bootstrap') when my simple css files were in the css folder but now there are some other folders inside the webroot because of using the plugins for the frontend UI.
For this i have changed my url to like this $this->Html->css('/global/plugin/file')
Problem is on local it is working fine because of virtual host example.com but on live server i have domain like this 192.168.00.00/mysite so it go to the main directory to and link the ip 192.168.00.00 instead of going to 192.168.00.00/mysite.
Is there any good way to solve this and add the flexibility to the url so that my local and live will not be disturbed while i push my code through git?
Just removes '/' from $this->Html->css('/global/plugin/file') to below
<?php
$this->Html->css('global/plugin/file');
$this->Html->script('global/plugin/file'); //example loading file.js
?>
I already had an issue about this one including my JS and CSS inside a folder but when I removed '/' it solve my problem.
Confirm that their is a file.css inside plugin inside webroot\css\global\plugin\file.css windows path or LINUX path /webroot/css/global/plugin/file.css

CakePHP 2 path to webroot dir

How to create $this->Html->link(); to download file from Plugin webroot directory?
It's possible?
Why do you have to put the file in Plugin folder to be downloaded. This is not a good practice. Keep the file in webroot/file/name_of_folder
to get the path to webroot/ simply:
debug(WEBROOT);
Prefix with the plugin name
As mentioned in the docs, you can download plugin assets if the request url is prefixed with the plugin name (lower cased and underscored):
Simply prepend /plugin_name/ to the beginning of a request for an asset within that plugin, and it will work as if the asset were in your application’s webroot.
Note however that if the file is intended to be public it's a better idea for the asset to actually be in the webroot:
But keep in mind that handling static assets, such as images, Javascript and CSS files of plugins, through the Dispatcher is incredibly inefficient. It is strongly recommended to symlink them for production. For example like this:
ln -s app/Plugin/YourPlugin/webroot app/webroot/your_plugin
This would make it possible to access all files in a plugin's webroot directly without any rewrite or php logic being involved.

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.

ubercart file download setting problem

Hi I am using drupal 6.x and ubercart 2.x. I trie dto create a product,but when it comes to add the file download feature I am getting some issue. I put a folder called downloads in the drupal folder and one file inside the download folder.then I gave the path as "drupal/downloads but it is telling that drupal/downloads is not a valid file or directory"
I tied the following file paths too
1.www.mysite.com/drupal/downloads/faq.ods
2.drupal/downloads/faq.ods
3.drupal/faq.ods(after putting faq.ods in the drupal folder.
But still I am getting the same message. Plesae some body help me
It is looking for a path rather than a URL. You should probably aim to find out from your hosting company what the absolute path for your webroot is (e.g. www.mysite.com may actually be on disk as /users/mysite.com/httpdocs) and put in that followed by /drupal/downloads

Resources