IMPORTANT RULES:
- Maintain the original formatting (markdown, HTML tags, links, etc.)
- Keep technical terms and proper nouns as appropriate
- Preserve code blocks and technical syntax exactly
- Maintain the same tone and style
- Only output the translated text, no explanations or comments
It would be wrong to assume that a platform with intense usage and a broad ecosystem—like WordPress—can quickly adapt to different development environments and languages, or that such a need would even exist.
Of course, this is just my personal opinion. With the availability of a wide range of options and no longer limited by technical knowledge, it’s now convenient to switch between systems in just a few minutes. In the following few articles, I’ll discuss blog structures that I believe will be useful to you at least in terms of having a clear idea. The first article will focus on Grav.
Grav: How It Works
GRAV is a content management system built on PHP, without a database, and with a very simple user interface. You can download it quickly from the getgrav.org website1. In fact, I also explained in the article titled Running PHP Without Installation on macOS X how macOS X users can try out the system, which you’re welcome to review.
Yes, Grav operates without any database requirements and defines itself as a file-based web platform. That is, unlike content management applications such as WordPress, which rely on databases like MySQL for data creation and management, Grav does not require such features. Instead, data is managed in plain text files. This allows for easy transfer to any directory you prefer or to different hosting (hosting) environments, with only minor adjustments (such as file permissions). Grav also offers the ability to use different design architectures, and can be used immediately right after download. If we were to delve into the technologies used in the platform, which are the best examples of its architectural design, we would note the following:
- Twig Templating: Something that Symphony users will recognize. A fantastic template engine.
- Markdown: Enables you to easily create content.
- YAML: Provides simple configuration editing capabilities.
- Parsedown2: Offers access to Markdown and Markdown Extra features.
- Doctrine Cache: Handles performance optimizations.
- Pimple Dependency Injection Container3: Will assist you during maintenance and development.
- Symfony Event Dispatcher4: Executes plugin interactions.
- Symfony Console5: Command-line interface
- Gregwar Image Library6: Image manipulation library.
System behaviors, forms, and content features can be defined through YAML files/lines. This minimizes the need to write code. If you’re familiar with the Twig syntax, you can easily create themes.
For using Grav, which allows you to fully customize your site, you’ll need a basic web server (such as Apache, Nginx, LiteSpeed, Lighttpd, IIS, etc.) and a PHP version 5.5.9 or higher. Yes, that’s all. If you’re using macOS X and your system is OS X 10.9 Mavericks or later, the Apache Web Server and PHP 5.5 already installed on your system will fully handle your needs. On the other hand, if you’re using a virtual server application such as MAMP/MAMP Pro for macOS X, or XAMPP, EasyPHP, MAMP, or ISS for Windows, you already know what to do.
Apache Configuration
Although most Apache distributions come with various configuration settings that meet your requirements, for your reference, you should verify that the mod_rewrite and mod_ssl modules are installed and that the <VirtualHost> and <Directory> sections have the AllowOverride All directive defined so that .htaccess can function properly. For any issues you may encounter during installation, please refer to the Basic Requirements page7.
Quick and easy setup, along with no requirement for a database (such as MySQL), makes Grav a powerful tool that saves you from many technical tasks. So, how exactly do you install Grav?
Grav is available in two packages: Grav and Grav + Admin. After installation, you can easily switch to the other package. Simply unzip the (*.zip) folder and transfer the files to your desired directory via FTP to begin using Grav. Additionally, if you’re using a Windows 10+ operating system environment, you can refer to the article titled Grav Installation on Windows for detailed instructions.
Another installation method—and one I strongly recommend—is using Composer8. If you’re a macOS X user, I’ll be sharing many practical tips via the terminal in the coming days that will make your work much easier. I recommend adding these tips to your frequently used tools. Once you’ve opened the terminal, follow these steps:
cd ~/download-directory
git clone -b master https://github.com/getgrav/grav.git
composer install --no-dev -o
We’ve completed the basic setup, and now we move on to installing extensions and themes.
cd ~/webroot/grav
bin/grav install
The default content added during the initial setup appears as follows:
With the Grav + Admin package, you gain the ability to create and edit content directly through the content management panel. However, you should also know that using the Grav package, you can create content in any way you prefer, without any difficulties, simply by directly managing files. After the Admin installation, you can access the admin panel via the URL: domain.com/your-installation-directory/admin.
In the standard package installation, you create your content under the user/pages/ directory.
---
title: A New Article
---
# Hello, World!
This is my **first** blog post published using _Grav_.
Let’s save the content above under 02.hakkimda as default.md. That is, the directory structure for the page will look like: user/pages/02.hakkimda/default.md.
Yes, that’s all. When you refresh the page, you’ll notice that Grav has quickly completed all the remaining operations. You can also easily install extensions and themes through the admin panel. Antimatter comes pre-installed with the setup. You can easily access and install other themes via the admin panel (Admin > Themes > Install). Basic extensions are also pre-loaded in the admin panel, and you can quickly access new extensions from the relevant page.
If you have any questions regarding installation or after, please share them in the comments. Let’s now move on to a practical method that will allow users with macOS X 10.9 Mavericks or later to quickly experience Grav.
Grav Installation on Localhost
There are a few things we need to check first. The first one is the PHP version installed on your computer. When you run the following command in the command line, the response should indicate that you have at least a PHP version of 5.5.9 or higher.
php -v
The response I received is as follows:
PHP 5.6.30 (cli) (built: Feb 7 2017 16:18:37)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
After this step, we can now start our virtual server.
php -S 127.0.0.1:8888 system/router.php
Using the above command, you will see a directory path indicating where you should upload your Grav files. After running the command, the response I received was as follows:
PHP 5.6.30 Development Server started at Mon Jun 19 22:04:30 2017
Listening on https://localhost:8888
Document root is /Users/username
I hope this article has been useful and that you have already begun thinking about and planning the content you will be publishing. You can follow my personal experiences and recommendations regarding Grav through the Grav category.
*[YAML]: YAML Ain’t Markup Language
*[PHP]: PHP: Hypertext Preprocessor