我无法从我的Codeigniter应用程序连接到Amazons RDS服务.
数据库配置中的设置:
$db['default']['ssl_set'] = TRUE;
$db['default']['ssl_key'] = NULL;
$db['default']['ssl_cert'] = NULL;
$db['default']['ssl_ca'] = realpath('./application/third_party/mysql-ssl-ca-cert.pem');
$db['default']['ssl_capath'] = NULL;
$db['default']['ssl_cipher'] = NULL;
Run Code Online (Sandbox Code Playgroud)
但是,当我连接.我收到消息:
无法选择指定的数据库:暂存文件名:...\system\database\DB_driver.php行号:140
第40行显示在这里:
// Select the DB... assuming a database name is specified in the config file
if ($this->database != '')
{
if ( ! $this->db_select())
{
log_message('error', 'Unable to select database: '.$this->database);
if ($this->db_debug)
{
$this->display_error('db_unable_to_select', $this->database); // LINE 140
}
return FALSE;
}
Run Code Online (Sandbox Code Playgroud)
我进行了以下更改以mysqli使用SSL:
我很惊讶它连接成功,因为它抱怨数据库选择.不知道从哪里去?
我在5.3.8Windows机器上使用PHP .
这变成了一个bug而不是我的实现问题.如果我设置$db['default']['db_debug']为 …
我正在CodeIgniter(v 2.1.0)上构建一个视频站点.管理员可以通过管理面板上传视频.它在我的本地服务器上运行良好.但是在远程测试服务器上,它无法正常工作.我已将mimes.php设置为正确识别文件类型.允许的文件类型没问题.但错误消息表明不允许使用文件类型.这是我的mimes.php:
...
'mp4' => 'video/mp4',
'flv' => 'video/x-flv',
'avi' => 'video/x-msvideo',
'mpeg' => 'video/mpeg',
...
Run Code Online (Sandbox Code Playgroud)
文件类型:
$upload_config['allowed_types'] = 'flv|mp4|avi|mpeg'
Run Code Online (Sandbox Code Playgroud)
上传库初始化$this->upload->initialize($upload_config);如果我为$ _FILES执行var_dump它会给我:
array(1) { ["video_file"]=> array(5) { ["name"]=> string(48) "test_video_file.mp4" ["type"]=> string(9) "video/mp4" ["tmp_name"]=> string(14) "/tmp/phpwkOICI" ["error"]=> int(0) ["size"]=> int(5668643) } }
Run Code Online (Sandbox Code Playgroud)
这有什么问题?令我疯狂的是,相同的脚本在我的本地计算机上运行正常,但在远程测试子域上不起作用.每个调试消息对我来说都是合法的.任何帮助深表感谢.感谢致敬
我正在尝试上传图片并调整它们的大小,到目前为止上传工作还有拇指指甲图像的创建.但我不能让原始图像调整大小.所有发生的事情是文件以原始大小直接上传到文件夹.我想我正在尝试将此图像调整大小然后覆盖最初上传的文件.
这是我的代码,我错过了什么:
//Initialise the upload file class
$config['upload_path'] = './image_uploads/';
$config['allowed_types'] = 'jpg|jpeg|gif|png';
$config['max_size'] = '6048';
$this->load->library('upload', $config);
$userfile = "_upload_image";
//check if a file is being uploaded
if(strlen($_FILES["_upload_image"]["name"])>0){
if ( !$this->upload->do_upload($userfile))//Check if upload is unsuccessful
{
$upload_errors = $this->upload->display_errors('', '');
$this->session->set_flashdata('errors', 'Error: '.$upload_errors);
redirect('admin/view_food/'.$food->course_id);
}
else
{
//$image_data = $this->upload->data();
////[ THUMB IMAGE ]
$config2['image_library'] = 'gd2';
$config2['source_image'] = $this->upload->upload_path.$this->upload->file_name;
$config2['new_image'] = './image_uploads/thumbs';
$config2['maintain_ratio'] = TRUE;
$config2['create_thumb'] = TRUE;
$config2['thumb_marker'] = '_thumb';
$config2['width'] = 75;
$config2['height'] = 50;
$this->load->library('image_lib',$config2); …Run Code Online (Sandbox Code Playgroud) 我经常搜索并发现很多关于这个问题的问题,遗憾的是没有一个答案对我有帮助.
我正在尝试上传png图像,我收到以下错误:
您尝试上传的文件类型是不允许的.
我正在遵循此CI指南来构建我的代码:http://codeigniter.com/user_guide/libraries/file_uploading.html
这是我得到的:
查看文件:
[..]
<?= form_open_multipart() ?>
<input type="file" name="userfile" size="20" />
<br /><br />
<input type="submit" value="upload" />
<?= form_close() ?>
[..]
Run Code Online (Sandbox Code Playgroud)
我的控制器:
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$xx = array('upload_data' => $this->upload->data());
$mimetype= $xx['upload_data']['file_type'];
var_dump('Mime: ' . $mimetype);
var_dump($_FILES);
if ( !$this->upload->do_upload())
{
Notice::add($this->upload->display_errors(), 'error');
}
else
{
$data['upload_data'] = $this->upload->data();
}
Run Code Online (Sandbox Code Playgroud)
如你所见,我正在尝试var_dumpmime类型,结果是空的.
当我这样做var_dump($_FILES)时看起来一切都很好:
array(1) { …Run Code Online (Sandbox Code Playgroud) 我目前正在写关于网络安全的论文.我专注于在Web应用程序中使用身份验证库.作为其中的一部分,我正在为CodeIgniter编写一个库,旨在通过实现对许多OAuth提供程序的支持来提供单点登录类型的身份验证.
我对你们的问题,社区如下:
到目前为止,我对此的考虑是关于速度,代码的简单性,应用程序开发人员的实现简单性以及最重要的是产品的实际安全性.
任何反馈都会受到高度重视.非常感谢.
以下重定向网址使用http%3A%2F%2F而不是http://.我怎么能避免这个?
提前致谢.
$params = array(
'client_id' => $client_id,
'redirect_uri' => site_url('welcome/google_connect_redirect/'),
'state' => $_SESSION['state'],
'approval_prompt' => 'force',
'scope' => 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email',
'response_type' => 'code'
);
$url = "https://accounts.google.com/o/oauth2/auth?".http_build_query($params);
// send to google
redirect($url);
Run Code Online (Sandbox Code Playgroud)
URL变成这样.
https://accounts.google.com/o/oauth2/auth?client_id=871111192098.apps.
googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8888%2Fmyappname
%2Findex.php%2Fwelcome%2Fgoogle_connect_redirect&state=f0babsomeletterscb5b48753358c
3b9&approval_prompt=force&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2F
userinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&
response_type=code
Run Code Online (Sandbox Code Playgroud) 我最近在我的Lion OS X 64bit上将我的PHP升级到版本5.4.1,我在Codeigniter中遇到错误:
Severity: Warning
Message: preg_match(): Compilation failed: unknown option bit(s) set at offset 0
Filename: core/Utf8.php
Line Number: 44
Run Code Online (Sandbox Code Playgroud)
我用Google搜索了问题,这似乎是PHP中PCRE库的一个问题,我按照本教程显示用我自己安装的自制软件安装pcre(我正在运行pcre 8.30)并且这并没有解决问题.
我一直在寻找解决方案,但我没有遇到过一个有帮助的方法 - 有没有一种解决这个PCRE库问题的方法?
编辑:刚刚编辑了这个问题,以提醒我我的安装是什么:
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
--with-kerberos=/usr \
--with-zlib=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--with-curl=/usr \
--enable-dba \
--enable-exif \
--enable-ftp \
--with-gd \
--with-freetype-dir=/usr/X11/ \
--with-jpeg-dir=/usr \
--with-png-dir=/usr/X11/ \
--enable-gd-native-ttf \
--with-icu-dir=/usr \ …Run Code Online (Sandbox Code Playgroud) 我已在子网站www.siteb.com/rexona中安装了CI
我的.htaccess在www.siteb.com/rexona内:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /rexona
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#‘system’ can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn’t true it sends the
#request to …Run Code Online (Sandbox Code Playgroud) 我想使用表单验证来要求密码具有BOTH字母和数字字符.这是我到目前为止所提出的:
$this->form_validation->set_rules('password', 'Password', 'required|matches[passconf]|min_length[8]|alpha_numeric');
Run Code Online (Sandbox Code Playgroud)
问题是"alpha_numeric"要求密码只包含字母或数字,它不需要两者.在这里寻求更强大的密码选项.
有没有人有使用这个插件的经验?我已经获得了php的客户端库,并在我的控制器中设置了相应的功能.当我从香草的插件设置页面点击"测试"时,我得到一个有效的回复,但现在我被卡住了......我从哪里开始?
为了更清楚这个问题,我不知道我的下一步是什么.我的意思是,我知道我必须遗漏一些东西......继承人我正在使用的控制器功能(或页面)作为插件的端点:
// 1. Get your client ID and secret here.
$clientID = "1234";
$secret = "1234";
// 2. Grab the current user from your session management system or database here.
//so i check to see if the user is logged in to my codeigniter's auth
//all works fine
// 3. Fill in the user information in a way that Vanilla can understand.
$user = array();
if ($signedIn) {
// i then set these according to the user info of …Run Code Online (Sandbox Code Playgroud) codeigniter ×10
php ×8
amazon-rds ×1
file-upload ×1
mime-types ×1
oauth ×1
passwords ×1
pcre ×1
security ×1
ssl ×1
validation ×1