Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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



38.3k
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: http://www.w3schools.com/php/func_filesystem_parse_ini_file.asp



12.8k

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



12.8k

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: http://www.w3schools.com/php/func_filesystem_parse_ini_file.asp