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 7 years ago · 1 replies · 554 views
7 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?

7 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 jean-louis67, 3 weeks ago
2 315 3 weeks ago
General · by Andy Miller, 4 weeks ago
0 312 4 weeks ago
General · by Veehem, 4 weeks ago
0 264 4 weeks ago
General · by milkboy, 4 weeks ago
0 270 4 weeks ago
General · by ian russell, 1 month ago
2 338 1 month ago