Welcome Guest, Not a member yet? Register   Sign In
Call to DB and Files outside the Public Folder
#1
Star 

Dear CodeIgniter Community, First post, Yay !  Big Grin

Need some help.


We are using Code-Igniter as the base frame for our website (custom tailored). The way it's programmed, we can call from the website to some files and databases that are stored outside the public folder (for security reasons), we had a domain/server transition few days back, and currently the website is broken because it's not allowing us to those calls (system_path). 
I'm wondering if you may point us in the right direction of what to double check or test.

Thanks in advance  Blush
Reply
#2

Post the actual error messages you are getting.
Reply
#3

The main web works fine, http://mydomainname.com/
The error I get from all the child ulrs is this one:



Quote: Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.



I have tried the suggestions of the CodeIgniter troubleshoot page, because I am in doubt that my server is supporting the REQUEST_URI variable needed to serve search-engine friendly URLs, since I can actually see my own Index page but all the other URL's with CodeIgniter are printing the above error.

On the config file I have:

Quote:|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/

$config['index_page'] = "index.php?";

/*
|--------------------------------------------------------------------------
| 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'] = "REQUEST_URI";


And on the index file I have"

Quote:/*
 *---------------------------------------------------------------
 * SYSTEM FOLDER NAME
 *---------------------------------------------------------------
 *
 * This variable must contain the name of your "system" folder.
 * Include the path if the folder is not in the same  directory
 * as this file.
 *
 */
 $system_path = 'pik';

/*
 *---------------------------------------------------------------
 * APPLICATION FOLDER NAME
 *---------------------------------------------------------------
 *
 * If you want this front controller to use a different "application"
 * folder then the default one you can set its name here. The folder
 * can also be renamed or relocated anywhere on your server.  If
 * you do, use a full server path. For more info please see the user guide:
 * http://codeigniter.com/user_guide/genera..._apps.html
 *
 * NO TRAILING SLASH!
 *
 */
 $application_folder = 'sam';


As you can see, I changed
  • $config['index_page'] = "index.php";
 to 
  •  $config['index_page'] = "index.php?"; 
Yet, it is not working.

Is it something to do with the config in here ? :


Quote:/*
|--------------------------------------------------------------------------
| 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'] = "REQUEST_URI";


Also, what can I do to set or to add REQUEST_URI support on the server ?  Huh

I hope I was able to explain myself   Big Grin
Reply
#4

In general, if something doesn't work to fix the problem, you probably want to immediately change it back to its previous state before trying something else. I don't think the addition of the question mark in the config is especially helpful, as it really indicates that the configuration of the server is wrong (as the question mark should be part of the rewrite rule, if it is needed).

The first thing I would check would be to make sure that any .htaccess files and all configuration files were transferred properly to the new server. In some environments, it's relatively common for someone to use a tool to transfer files which doesn't include hidden files.

Next, compare the web server's configuration to the configuration on the prior server. Also check the version of the web server, as you may need to make specific configuration changes when transitioning from one version to another (for example, Apache 2.2 to 2.4).

Another consideration is the permissions on the files and directories. Whenever possible, I configure a group which includes the web server's account (usually apache or www-data) and the account(s) used to update/upload files and control permissions primarily based on group rather than owner, which reduces the likelihood that the server will be unable to access a file without requiring overly-broad permissions. A good read for understanding permissions is here: http://serverfault.com/questions/357108/...-webserver
Reply




Theme © iAndrew 2016 - Forum software by © MyBB