Search code examples
phpcodeigniterwebhostingpyrocms

How to host my PyroCMS web page


So I have created my web page based on PyroCMS, adding some custom modules. Developing was done on localhost using wampserver. Now I need to put this website online, so I'm trying to test it using free hosting. I uploaded my project folder on webhost, imported database, changed database.php file for new connection settings.

But, when trying to custom modules from web site, I get message: "We cannot find the page you are looking for, please click here to go to the homepage."

What am I missing here? Everything was working good on localhost, I guess there is something I havent changed :/

Edited: Maybe this helps - in control panel/add-on I get this error message: Message: Invalid argument supplied for foreach()

Filename: models/module_m.php

Line Number: 479


Solution

  • The default URI_PROTOCOL is wrong, or not correctly detected by your host. Play with the settings in config/config.php. I have the most success with PATH_INFO instead of AUTO

    /*
    |--------------------------------------------------------------------------
    | URI PROTOCOL
    |--------------------------------------------------------------------------
    |
    | This item determines which server global should be used to retrieve the
    | URI string.  The default setting of 'AUTO' works for most servers.
    | If your links do not seem to work, try one of the other delicious flavors:
    |
    | 'AUTO'            Default - auto detects
    | 'PATH_INFO'       Uses the PATH_INFO
    | 'QUERY_STRING'    Uses the QUERY_STRING
    | 'REQUEST_URI'     Uses the REQUEST_URI
    | 'ORIG_PATH_INFO'  Uses the ORIG_PATH_INFO
    |
    */
    $config['uri_protocol'] = 'PATH_INFO';