We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Configuration file config.ini can't be loaded

<?php

use Phalcon\Mvc\Application;
use Phalcon\Config\Adapter\Ini as ConfigIni;

try{
    define('APP_PATH', realpath('..') . '/');
    $config = new ConfigIni(APP_PATH . 'app/config/config.ini');
    // ......

Hi,

sorry to bother you. I have the error "Configuration file config.ini can't be loaded" while the file path is correct. Do you have any idea. FYI I'm using Phalcon 2, CentOS 7, PHP 5.4

thanks in advance,


update

the cause of the error is located: I use the word "on" as a name of a key (like: on = TRUE). if anyone can provide more prohibited name, I am willing to give points to you.

tail -f /var/log/httpd-error.log



77.7k
Accepted
answer

The following reserved words must not be used as keys for ini files: null, yes, no, true, and false.

Furthermore, there are also some reserved characters that must not be used in the keys: {}|&~![()".

Source: https://www.w3schools.com/php/func_filesystem_parse_ini_file.asp



25.7k

I checked the http error log, perhaps I didn't make my application to write Phalcon error to the log file, so at that moment I basically have no clue.

tail -f /var/log/httpd-error.log



25.7k

Thanks for the info. This might help myself or other people who have the same struggle.

The following reserved words must not be used as keys for ini files: null, yes, no, true, and false.

Furthermore, there are also some reserved characters that must not be used in the keys: {}|&~![()".

Source: https://www.w3schools.com/php/func_filesystem_parse_ini_file.asp