# Stylesheets, images, and javascript files don't load

**URL:** <https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109>\
**Category:** Need Help\
**Created:** [March 11, 2021, 1:05am UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109 "2021-03-11T01:05:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 1:05am UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/1 "2021-03-11T01:05:32Z")

</div>

The stylesheet at my site doesn’t load

I am using CakePHP version 2.2.3

The following is in the file: app\View\Elements\header.ctp

`<?php echo $this->Html->css(array('myownmealplanner', 'fullcalendar', 'jquery-ui')); ?>`

The stylesheet is here: app\webroot\css

When I click on the stylesheet in view source, it doesn’t go to the file. Instead I get the error message: [an error occurred while processing this directive]

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [March 11, 2021, 4:49am UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/2 "2021-03-11T04:49:35Z")

</div>

What URL is it generating for the stylesheet, and what URL can you actually access it through?

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 12:29pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/3 "2021-03-11T12:29:12Z")

</div>

I can’t access the stylesheet at all. When I click on the stylesheet from view source, it goes to [https://www.myownmenuplanner.com/css/myownmealplanner.css](https://www.myownmenuplanner.com/css/myownmealplanner.css) but it doesn’t show the stylesheet. It gives me the error: [an error occurred while processing this directive]

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 12:34pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/4 "2021-03-11T12:34:04Z")

</div>

I am using PHP version 5.6

---

<div class="post-metadata">

**Author:** ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)\
**Post date:** [March 11, 2021, 2:23pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/5 "2021-03-11T14:23:55Z")

</div>

`https://www.myownmenuplanner.com/css/myownmealplanner.css` gives me 404 - not found.

Wouldn´t it make sense to upgrade your php and rebuild your project with cakephp4?

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 2:33pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/6 "2021-03-11T14:33:08Z")

</div>

Rebuilding my site is too much work. I just want to resolve the stylesheet issue easily. The rest of the app works, all I need is for the stylesheets to load.

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [March 11, 2021, 3:17pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/7 "2021-03-11T15:17:34Z")

</div>

Is there some URL that you can come up with that does work for that CSS? If so, what is it? If not, then your setup is broken and the problem is nothing to do with the HTML helper.

---

<div class="post-metadata">

**Author:** ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)\
**Post date:** [March 11, 2021, 3:38pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/8 "2021-03-11T15:38:08Z")

</div>

> [@dirk](#):
>
> [https://www.myownmenuplanner.com](https://www.myownmenuplanner.com)

All links on this page produce “an error occurred while processing this directive]”.  
Maybe this could help:

> <https://stackoverflow.com/questions/6022579/cakephp-404-page-not-found-error-when-deploying-on-a-different-machine>

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 11:29pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/9 "2021-03-11T23:29:57Z")

</div>

Thanks, dirk.  
I uploaded a test.html file to the root and the stylesheet loaded so it seems to be a CakePHP issue.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 11:48pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/10 "2021-03-11T23:48:33Z")

</div>

I changed my file permissions but I still get the error

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 11:50pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/11 "2021-03-11T23:50:10Z")

</div>

The error has changed a little bit. It’s now saying: Not Found Error: The requested address ‘/css/test.css?url=css%2Ftest.css’ was not found on this server.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 11:51pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/12 "2021-03-11T23:51:20Z")

</div>

test.css is an empty file that I created because some sources that I googled said that the error could be a result of comments in the file.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 11:56pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/13 "2021-03-11T23:56:43Z")

</div>

I also uploaded test.php to check if php was working and it worked. It loaded the stylesheet.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 11, 2021, 11:59pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/14 "2021-03-11T23:59:59Z")

</div>

I previously wasn’t getting any errors so I didn’t report on that but now I’m getting an error in my error\_log file. The error is: [11-Mar-2021 20:24:21 UTC] PHP Fatal error: Call to undefined method mysqli::getSchemaName() in /home/sg79q2bkshgg/public\_html/myownmenuplanner.com/lib/Cake/Model/Model.php on line 3168

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 12, 2021, 12:39am UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/15 "2021-03-12T00:39:00Z")

</div>

I am consulting with Go Daddy now to make sure my database is configured correctly.

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 12, 2021, 1:08am UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/16 "2021-03-12T01:08:20Z")

</div>

Go Daddy couldn’t help me.  
I introduced errors into my app/Config/database.php file to look at the error message but there was no error message. I think the database config is wrong but I don’t see how to check it.

---

<div class="post-metadata">

**Author:** ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)\
**Post date:** [March 12, 2021, 12:38pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/17 "2021-03-12T12:38:34Z")

</div>

> [@makamo66](#):
>
> Call to undefined method mysqli::getSchemaName(

What maybe could help…  
Please take a look in your config/database.php.  
what is the value of “datasource” ? is it “Database/Mysql” or “Database/Mysqli” ?

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 12, 2021, 1:27pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/18 "2021-03-12T13:27:55Z")

</div>

It’s ‘datasource’ =\> ‘Database/Mysqli’,

---

<div class="post-metadata">

**Author:** ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)\
**Post date:** [March 12, 2021, 2:06pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/19 "2021-03-12T14:06:35Z")

</div>

what happens if you change it to “Database/Mysql” ?  
Do you still get the Error

> undefined method mysqli

?

---

<div class="post-metadata">

**Author:** ![makamo66](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/makamo66/32/2156_2.png) [@makamo66](https://discourse.cakephp.org/u/makamo66)\
**Post date:** [March 12, 2021, 2:15pm UTC](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109/20 "2021-03-12T14:15:08Z")

</div>

I changed it and I still get the error: [12-Mar-2021 00:55:05 UTC] PHP Fatal error: Call to undefined method mysqli::getSchemaName() in /home/sg79q2bkshgg/public\_html/myownmenuplanner.com/lib/Cake/Model/Model.php on line 3168

[Next page](https://discourse.cakephp.org/t/stylesheets-images-and-javascript-files-dont-load/9109.md?page=2)
