hi all,

I have tried to deploy my Grav project to Apache, but it’s complicated. I have to test before deploy this Grav’s website on shared hosting so I emulated docker-apache-php7.1 enviroment (grav-docker-apache precisely).
When I want to load grav it’s throwing following ErrorException:
“array_merge(): Argument #2 is not an array”
in this line:
$defaults = (array)$config->get(‘system.pages.markdown’); if (isset($this->header()->markdown)) { $defaults = array_merge($defaults, $this->header()->markdown); }
And it’s throwing following ErrorException during load admin:
"Declaration of Grav\Plugin\Babel\BabelSearch::setTokenizer(TeamTNT\TNTSearch\Support\TokenizerInterface $tokenizer) should be compatible with TeamTNT\TNTSearch\ ▶"
Can someone helps me?
@amirghanbariir,
First a kind request… Please consider formatting your code correctly using triple back-ticks (```) and adding the origin of the code. It saves me searching the source code of Grav.
The closest resembling code was found in: ‘/system/src/Grav/Common/Page/Page.php’ line 866.
$markdownDefaults = (array)$config->get('system.pages.markdown');
if (isset($this->header()->markdown)) {
$markdownDefaults = array_merge($markdownDefaults, $this->header()->markdown);
}
My guess is that the Yaml in the frontmatter of your page is invalid and does not yield a proper array after parsing. Eg. the following frontmatter throws error ‘array_merge(): Argument #2 is not an array’:
---
title: My fancy title
markdown: x: <-- invalid Yaml
---
Did you debug your code to see what the value is of $this->header()->markdown
?