Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Getting an error while starting Grav CMS

Solved by pamtbaau View solution

Started by bedoonraj 1 year ago · 7 replies · 295 views
1 year ago

Getting below error while starting Grav CMS
gravcms|690x344

1 year ago

@bedoonraj, The information you've provided is not sufficient enough to pinpoint the issue.

Please provide the following information:

  • when does it happen?
    • when using Admin,
    • or when using the website?
  • the top 10 errors from the error logfile in /logs/grav.log
  • a list of plugins you are using
  • the theme you are using
1 year ago

@pamtbaau I'm first time downloading this tool. What i have done so far is

  1. Download and Installed PHP (8.4.7)
  2. Download and extracted Grav Core+Admin Plugin
  3. With CMD, executed php -S localhost:8000 system/router.php

After doing i'm getting this error:

[2025-05-20 06:32:30] grav.CRITICAL: Failed to start session: session_start(): Session cannot be started after headers have already been sent - Trace: #0 C:\grav-admin\system\src\Grav\Common\Session.php(49): Grav\Framework\Session\Session->start() #1 C:\grav-admin\system\src\Grav\Common\Processors\InitializeProcessor.php(452): Grav\Common\Session->init() #2 C:\grav-admin\system\src\Grav\Common\Processors\InitializeProcessor.php(109): Grav\Common\Processors\InitializeProcessor->initializeSession(Object(Grav\Common\Config\Config)) #3 C:\grav-admin\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\InitializeProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #4 C:\grav-admin\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #5 C:\grav-admin\system\src\Grav\Framework\RequestHandler\Middlewares\MultipartRequestSupport.php(40): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #6 C:\grav-admin\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Framework\RequestHandler\Middlewares\MultipartRequestSupport->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #7 C:\grav-admin\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #8 C:\grav-admin\system\src\Grav\Common\Grav.php(312): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #9 C:\grav-admin\index.php(47): Grav\Common\Grav->process() #10 C:\grav-admin\system\router.php(55): require('C:\grav-admin\i...') #11 {main} [] []

last edited 05/20/25 by bedoonraj
1 year ago Solution

@bedoonraj, I believe PHP 8.4.x requires Grav 1.8 beta

1 year ago

@bedoonraj, Unfortunately, you've cross-posted this post on Gravs repo within 6 minutes apart.

In general, it is not very appreciated if users of different forums are being asked the same question. In the end, people of at least one forum are wasting time and effort.

It is OK to cross-post once the first post does not receive a proper answer. But not within 6 minutes, but after a day or so. And when cross-posting, all parties should be notified about the cross-posting and results should be shared in all forums.

👍 1
1 year ago

I installed new version of Grav in a 8.4.7 php. Those errors are simple to correct.
In each file and line in the error message, where is:

PHP
function my_function(string $var = null){

must be in 8.4 php release:

PHP
function my_function(?string $var = null){

after corrections there is any other error, is just those simple.

last edited 06/02/25 by pamtbaau
1 year ago

@cesarmarinhorj, If it were that simple, Grav 1.7.x would have been made PHP 8.4 compatible in a blink of an eye... But there is more to it, according to the lead developer:

[..] There's more than just nullable paramaters at play, there's all the library dependencies on other libraries that need to support 8.4.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 51 8 hours ago
Support · by Anna, 2 days ago
2 58 10 hours ago
Support · by Justin Young, 11 hours ago
1 30 11 hours ago
Support · by Duc , 1 week ago
2 63 5 days ago
Support · by Colin Hume, 1 week ago
2 55 5 days ago