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

config.ini cannot be loaded

Hi, I am new to phalcon.I am using the INVO example on windows.There is a line of code '$config = new ConfigIni(APP_PATH . 'app/config/config.ini');' in 'invo/public/index.php'. Since it is in windows, I changed the code to be '$config = new ConfigIni(APP_PATH . 'app\config\config.ini');'.

But it does not work. When I run this file ,it says 'beforeConfiguration file 'C:\Users\Rambo\Documents\My Web Sites\EmptySite1\app\config\config.ini' cannot be loaded'.

Can anybody help?



1.4k
Accepted
answer
edited Apr '15

Hi,

Even with Windows, it is not necessary to change the line :

    $config = new ConfigIni(APP_PATH . 'app/config/config.ini');

The path C:\Users\Rambo\Documents\My Web Sites is it really the root of your web server? and EmptySite1 folder contains files related to Invo? If that's the case, it is a bad idea ...

It may be that this localization poses permission problems. I will try to move the server root to another location (c:\www eg)



1.8k

I finally solved the problem. The path C:\Users\Rambo\Documents\My Web Sites\EmptySite1\app\config\config.ini is correct, it is because of the config.ini file . The original file has a line of code:

baseUri = /invo/ Since I am using IIS instead of Apache,I can not use the .htaccess file.So I changed this line of code to be

baseUri = /public/index.php?_url=/

Then,phalcon can not load the file anymore. But after I added quotes to the uri like this:

baseUri = "/public/index.php?_url=/"

Phalcon worked!