Stylesheets, images, and javascript files don't load

I’m sorry, I can’t help you. I thought it was a misconfiguration of your database config.

I changed my core.php file so that it prints out debug information. Here is the error message it gives me now when I click on a link: Unable to configure the session, setting session.gc_maxlifetime failed.
Error: An Internal Error Has Occurred.

Stack Trace
CORE/Cake/Model/Datasource/CakeSession.php line 188 → CakeSession::_configureSession()
CORE/Cake/Model/Datasource/CakeSession.php line 360 → CakeSession::start()
CORE/Cake/View/Helper/SessionHelper.php line 44 → CakeSession::read(string)
APP/View/Mealplans/index.ctp line 3 → SessionHelper->read(string)
CORE/Cake/View/View.php line 921 → include(string)
CORE/Cake/View/View.php line 884 → View->_evaluate(string, array)
CORE/Cake/View/View.php line 476 → View->_render(string)
CORE/Cake/Controller/Controller.php line 956 → View->render(null, null)
CORE/Cake/Routing/Dispatcher.php line 193 → Controller->render()
CORE/Cake/Routing/Dispatcher.php line 161 → Dispatcher->_invoke(MealplansController, CakeRequest, CakeResponse)
APP/webroot/index.php line 92 → Dispatcher->dispatch(CakeRequest, CakeResponse)
ROOT/index.php line 42 → require(string)

I googled part of the error and found a helpful post about setting the session. I am going to implement it when I get home from work. Right now I’m at work and can’t work on it.

I am trying to set session.gc_maxlifetime 86400 in my php.ini file but I don’t know if that is the correct syntax. Maybe there is an equal sign or quotes; I don’t know.

I would like to try ini_set(‘session.gc_maxlifetime’,‘86400’); but I don’t know in which file to include this code.

Those were the errors I was getting in Chrome. When I use Firefox I just get the error: Call to undefined method mysqli::getSchemaName() in lib/Cake/Model/Model.php

I changed the datasource from mysqli to mysql and now I don’t get the error in lib/Cake/Model/Model.php I get the same errors as in Chrome now.

It seems like you have bigger issues than your session lifetime at the moment. Try just removing that for now and see where it gets you? When you’ve got something that works without it, then add it in, and you’ll know that if it breaks that’s the line that’s responsible.

Thanks for your input, Zuluru. What am I supposed to remove?

The main issue that I want to resolve now is where should I put: ini_set('session.gc_maxlifetime','1440'); I don’t know in which file to include this code.

So, the latest stack trace you posted shows that the error is happening not in any of your code, but in Cake core code. Looks like the _configureSession function of CakeSession is doing this call, using what you have set (perhaps it’s there by default) in the Session section of your config file. Does this match what you’re expecting? In other words, you don’t need to add a call to ini_set anywhere, it’s already happening for you. So:

  • If you’re trying to change the session lifetime from what’s being set, then the way to do that is by changing your config file, not adding a line of code somewhere.
  • If you’re getting this error as a result of changing your config file, then it’s that change that’s causing the problem, and you just need to fix what you’re providing there (maybe you’re setting it as a string but it requires an integer, for example).
  • If you’re getting this error out-of-the-box and are thinking somehow that the error message you’re seeing is telling you that you need to add a call to ini_set, then that’s not the case. Maybe your host doesn’t allow ini_set at all, for example.
  • If it’s something else, then you’ll need to be clearer about the issue.

Thanks, Zuluru What config file are you referring to?

Files are cached here:
app/tmp/cache/models
app/tmp/cache/persistent
app/tmp/cache/views

But they must be getting cached somewhere else as well because I get an error about session_start() in my AppController even though I deleted the code with session_start(). Where else are my files being cached?

My database content is showing up on one of my pages so at least the database config file is correct.

The files in those caches have nothing whatsoever to do with sessions. Sessions are stored elsewhere, exactly where depends on how everything is configured. Not actually sure where config file I’m referring to would be, as I never used v2, and I can’t find the source for that quickly online. But it’s presumably under the config folder, as that’s where it was in both v1 and v3.

I wrote session.save_path = “/app/tmp/cache” in my php.ini file but when I look at the phpinfo file it shows

Directive: session.save_path
Local Value: /var/cpanel/php/sessions/ea-php72
Master Value: /opt/alt/php56/var/lib/php/session

What should I set session.save_path to in my php.ini file then?

There’s just more and more questions here without anywhere near enough information to answer them properly. Is this a shared server you’re on? Where is “your php.ini” file, and are you sure that it’s even being looked at? Do they even let you change session details? What is the actual path to where your app is? ("/app/tmp/cache" is almost certainly not a real folder, it’ll be more like “/home/makamo66/app/tmp/cache”, for example.) Why do you even think that you need to change your session path? Why is the default not good enough?

Thanks for the feedback, Zuluru. You wrote: “Why do you even think that you need to change your session path? Why is the default not good enough?” The reason I want to change the session path is because I am getting the error: session_start(): open(/var/cpanel/php/sessions/ea-php72/sess_ifav1b2dud0lq2oos44h2q8ik5, O_RDWR) failed: No such file or directory So the path set by default by Go Daddy isn’t working. The path in the error message is the local value for the directive session.save_path as seen is my phpinfo file. Go Daddy support said that I can’t make changes with php.ini because I’m on a shared hosting plan.

When I click on my css file in view source, I see a page which instructs me to create CssController like this:
<?php
class CssController extends AppController {

	public function myownmealplanner.css() {

	}

}

but when I do this the errors that are logged all look like this:

[FatalErrorException] syntax error, unexpected '.', expecting '('