Wednesday, 16 November 2016

CakePHP: JS and CSS files are not loading

When you will search above topic over internet, lots of answers will pop-up. When I faced the same issue nothing worked, hence just to help someone who is in same shoes writing this post.

If apache is your web server and your cakephp project is in /var/www/html/ folder make sure that AllowOverride All enabled for /var/www/html

To enable AllowOverride All for /var/www/html following is an example for /etc/apache2/sites-available/000-default.conf


<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
        <Directory "/var/www/html">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>


</VirtualHost>


Thanks!!! Enjoy Programming :)

1 comment:

  1. Hello Shiv,

    Thanks for such a great info you have shared with us.
    Hope you will keep continue sharing like this in future.

    Thanks & Best Regards
    Hexagon | Magento Development Services India

    ReplyDelete

Thanks for your valuable comments.

Odoo 10: Close wizard and open standard form

Hi, Today we are going to learn how to open standard form after saving data in wizard. Let's say I have created an wizard to fill bas...