内部服务器错误
服务器遇到内部错误或配置错误,无法完成您的请求.
请联系服务器管理员admin @ localhost并告知他们错误发生的时间,以及可能导致错误的任何操作.
关于此错误的更多信息可在服务器错误日志.
为什么告诉我这个?
的.htaccess:
RewriteEngine On
RewriteBase /ci_series/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Run Code Online (Sandbox Code Playgroud)
问题:
页面不想显示这个简单的功能:
<?php
class Mycal extends CI_Controller {
function display() {
$this->load->library('calendar');
echo $this->calendar->generate();
}
}
Run Code Online (Sandbox Code Playgroud)
我正在使用框架codeIgniter
错误日志:
[Mon Aug 01 17:10:45 2011] [alert] [client 127.0.0.1] C:/wamp/www/ci_series/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/
[Mon Aug 01 17:10:52 2011] [alert] [client 127.0.0.1] C:/wamp/www/ci_series/.htaccess: Invalid command 'RewriteEngine', perhaps …Run Code Online (Sandbox Code Playgroud) 我正在使用自定义查询,因为Active Record equivelant对我不起作用.
在我的数据库软件SQLYOG中放置查询时,它可以正常工作,但在CodeIgniter中它说
发生数据库错误
错误号码:1096
没有使用表格
选择*
文件名:C:\ xampp\htdocs\midas\system\database\DB_driver.php
行号:330
这是我的查询:
SELECT intervention.department_id, department_name, COUNT(*)
FROM intervention
LEFT JOIN department ON department.department_id = intervention.department_id
GROUP BY intervention.department_id, department.department_name
ORDER BY COUNT(*) desc
LIMIT 1
Run Code Online (Sandbox Code Playgroud)
这是一个奇怪的问题.
这是我的架构:
为什么var_dump不在这里工作,ajax调用成功,但没有打印,甚至没有PHP的字符串文字打印.
我的控制器
function check_links() {
$matches = $this->input->get('matchesJSON');
var_dump($matches);
//$this->load->view('publish_links_view');
}
Run Code Online (Sandbox Code Playgroud)
Ajax调用
$.ajax({
type: 'GET',
dataType: 'json',
cache: false,
data: 'matchesJSON='+matchesJSON,
url: 'publishlinks/check_links',
success:
function(response) {
}
})
Run Code Online (Sandbox Code Playgroud) 我有没有/index.php/ URL的CodeIgniter,我想在视图中链接CSS文件.
我的.htaccess:
RewriteEngine on
RewriteCond $1 !^([a-zA-z0-9/])
RewriteRule ^(.*)$ index.php [L]
RewriteCond $1 !^(index.php|images|robots.txt|system|user_guide)
RewriteRule ^(.*)$ index.php/$1 [L]
Run Code Online (Sandbox Code Playgroud)
我的链接:
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>application/views/metrohacker/style.css" />
Run Code Online (Sandbox Code Playgroud)
使用/index.php/它可以工作,但我想要简单的URL ...
我正在开发一个codeigniter项目.我有关于CSS的问题.css以下列方式包含在标题中:
<link href="http://localhost/ebookazine/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/ebookazine/assets/css/typography.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/ebookazine/assets/css/FlashStatus.css" rel="stylesheet" type="text/css" />
<link href="http://localhost/ebookazine/assets/css/webshop.css" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud)
但没有css链接工作.有人帮忙吗?
这是我的上传功能
public function do_upload()
{
$config['upload_path'] = './upload/';
$config['allowed_types'] = 'gif|jpg|png';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('customer_photo'))
{
$responce->success = false;
$responce->data['error'] = $this->upload->display_errors();
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->_do_resize($data);
}
echo json_encode($responce);
}
Run Code Online (Sandbox Code Playgroud)
这是我在firebug控制台上看到的json
{"success":false,"data":{"error":"<p>The filetype you are attempting to upload is not allowed.<\/p>"}}</p>
Run Code Online (Sandbox Code Playgroud)
任何想法为什么它包含</p>和这些<\/p>?
问候
我目前正在使用Codeigniter作为我的默认框架来创建一些我的项目.但是,当我在我的服务器上上传项目时,3天后,我的服务器中的错误日志已超过1 MB.如何忽略此错误日志?错误日志是由我的服务器或codeigniter本身引起的吗?
非常感谢您的帮助.
我有一个editcategory视图,显示有关类别的详细信息,以及显示在视图底部的类别说明表.
类别描述表有两个用于编辑和删除的锚标记.我正在使用ajax传递要编辑的描述的id.需要调用控制器中的函数,该函数调用categorydescription模型并根据传递的id拉取记录.控制器需要将catDescription数组反馈给ajax成功函数.
已经有一个隐藏的div包含用于编辑描述的表单,但值设置如下
<label for="catlang_name">Name</label>
<input type="text" name="catlang_name" id="catlang_name" class="text ui-widget-content ui-corner-all" value="<?php echo set_value('catlang_name',$catDescription->catlang_name); ?>"/>
Run Code Online (Sandbox Code Playgroud)
我的问题是如何在Ajax中获取响应并分配
为了正常地将数据传递给视图,我可以在控制器内完成以下操作
$data['catDescription']=$this->CategoryModel->getCategoryDescriptionById($id)
$this->load->view('category/categoryEdit', $data,true);
Run Code Online (Sandbox Code Playgroud)
这是从模型返回的数据:
Array (
[0] => Array (
[catlang_id] => 1
[catlang_cat_id] => 10
[catlang_lang_id] => 2
[catlang_name] => french
[catlang_description] => test
)
[1] => Array (
[catlang_id] => 2
[catlang_cat_id] => 10
[catlang_lang_id] => 2
[catlang_name] => english
[catlang_description] => test
)
)
Run Code Online (Sandbox Code Playgroud)
任何建议将不胜感激.
干杯
我想在database.gniter用户指南的database.in中保存会话,举个例子来将一些数据存储在数据库中.
CREATE TABLE IF NOT EXISTS `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text DEFAULT '' NOT NULL,
PRIMARY KEY (session_id)
);
Run Code Online (Sandbox Code Playgroud)
现在我想在datbase中按会话存储额外的数据,例如request_token值.
$this->session->set_userdata('request_token','test');
Run Code Online (Sandbox Code Playgroud)
我该如何通过会话来做?
我正在扩展一个用CI编写的webapp,以便与visual basic应用程序进行通信.
首先,我想知道我选择的解决方案是否是一个不错的选择......我之前曾在xml-rpc上工作并将手放在REST服务中,但对我来说SOAP解决方案看起来更完整.我错了吗?
无论如何,到目前为止的问题是我无法在我的控制器内调用函数...这是我的代码:
class Webservice extends CI_Controller {
function __construct() {
parent::__construct();
}
public function index() {
$server = new SoapServer("http://www.site.com/test.wsdl");
$server->setObject($this);
//$server->addFunction('sayHello');
$server->handle();
}
function sayHello($name) {
$salute = "Hi " . $name . ", it's working!";
return $salute;
}
}
Run Code Online (Sandbox Code Playgroud)
我已经编译了wsdl文件,但在我调用site.com/webservice后,我收到以下错误:
SoapServer :: addFunction()[soapserver.addfunction]:试图添加一个不存在的函数'sayHello'
我也尝试将$ CI =&get_instance()传递给$ server-> setObject(),但我认为它与传递$ this相同.
更新 - 12/09/2011
我想通了......如果已经设置了整个对象$ this,则无需使用addFunction().SOAP将只调用wsdl文件中声明的函数,无论如何,我似乎无法将函数设置为privete/protected.
说过我不确定要继续使用SOAP ... Phil Sturgeon编写的教程使用REST方法显示了一个很好的解决方案,返回不同的响应类型(json,xml,serialize,csv).