【发布时间】:2018-08-25 03:46:57
【问题描述】:
我的 codeignitor 应用程序出错:
无法加载请求的文件:helpers/files_helper.php
能否详细说明问题出在哪里?
文件:autoload.php
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array( 'database', 'user_agent', 'image_lib', 'encryption', 'object_cache', 'email', 'app', 'gateways/app_gateway', 'sms' );
$CI = &get_instance();
$CI->load->helper('files');
$gateways = list_files(APPPATH.'/libraries/gateways');
foreach ($gateways as $gateway) {
$pathinfo = pathinfo($gateway);
// Check if file is .php and do not starts with .dot
// Offen happens Mac os user to have underscore prefixed files while unzipping the zip file.
if ($pathinfo['extension'] == 'php' && 0 !== strpos($gateway, '.') && $pathinfo['filename'] != 'App_gateway') {
array_push($autoload['libraries'], 'gateways/'.strtolower($pathinfo['filename']));
}
}
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
*/
$autoload['drivers'] = array('session');
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array(
'url',
'file',
'form',
'action_hooks',
'general',
'misc',
'func',
'datatables',
'custom_fields',
'defaults',
'merge_fields',
'app_html',
'email_templates',
'invoices',
'estimates',
'credit_notes',
'proposals',
'projects',
'tasks',
'fields',
'tickets',
'relation',
'tags',
'pdf',
'clients',
'database',
'upload',
'sales',
'themes',
'theme_style',
'pre_query_data_formatters',
'widgets',
'sms',
'deprecated',
);
if (file_exists(APPPATH.'helpers/system_messages_helper.php')) {
array_push($autoload['helper'], 'system_messages');
}
if (file_exists(APPPATH.'helpers/my_functions_helper.php')) {
array_push($autoload['helper'], 'my_functions');
}
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array('english');
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array( 'misc_model' , 'roles_model' , 'clients_model' , 'tasks_model' );
if(file_exists(APPPATH.'config/my_autoload.php')){
include_once(APPPATH.'config/my_autoload.php');
}
这个文件在我的codeigitor应用程序中的路径是application/config/autoload.php 我只是想从基本 URL 登录:http://crm.thecoder.pw/ 我收到此错误:无法加载请求的文件:helpers/files_helper.php
【问题讨论】:
-
也许这会对你有所帮助。 stackoverflow.com/questions/804399/…
-
@axiac 老兄认真的??它在我的那里:P
-
试过了,得到 500 错误。
-
只是出于好奇-您正在自动加载的帮助文件的数量似乎有点奇怪-您在用它们做什么? ;)
标签: php codeigniter