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

My project in Apache problem with migration to Apache

Started by amirghanbariir 6 years ago · 1 replies · 455 views
6 years ago

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?

6 years ago

@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.

PHP
$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':

YAML
---
title: My fancy title
markdown: x:              <-- invalid Yaml
---

Did you debug your code to see what the value is of $this->header()->markdown?

last edited 12/30/19 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
General · by Hanns Mattes, 1 day ago
1 36 21 hours ago
General · by Andy Miller, 21 hours ago
0 31 21 hours ago
General · by Jerry Hunt, 5 days ago
2 154 2 days ago
General · by pamtbaau, 2 days ago
1 102 2 days ago
General · by Andy Miller, 3 days ago
0 86 3 days ago