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.

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(APPPATH . 'app/config/config.ini');' in 'invo/public/index.php'. Since it is in windows, I changed the code to be '$config = new ConfigIni(APPPATH . '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.1k
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)



720

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!