gpt4 book ai didi

php - 需要帮忙!我无法使用 codeigniter 在 oracle 11g 中连接我的程序

转载 作者:行者123 更新时间:2023-11-29 02:51:13 25 4
gpt4 key购买 nike

我有一个使用 mysql 创建的程序,很快就会迁移到 oracle 11g 数据库。我的问题是我的页面总是“找不到”,即使我已经在我的 config.php 和 database.php 中设置了所有更改

这是我的代码

配置.php

$config['base_url'] = 'http://192.168.0.112:1521/testing/';

$config['base_url'] = 'http://192.168.0.112/testing/';

我还尝试在 url 上添加 index.php

数据库.php

$active_group = 'oracle';
$active_record = TRUE;

$tnsname = '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.112)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))';
//112
$db['oracle']['hostname'] = $tnsname;
$db['oracle']['username'] = 'sample';
$db['oracle']['password'] = 'samplepass';
$db['oracle']['database'] = 'test';

$db['oracle']['dbdriver'] = 'oci8';
$db['oracle']['dbprefix'] = '';
$db['oracle']['pconnect'] = TRUE;
$db['oracle']['db_debug'] = TRUE;
$db['oracle']['cache_on'] = FALSE;
$db['oracle']['cachedir'] = '';
$db['oracle']['char_set'] = 'utf8';
$db['oracle']['dbcollat'] = 'utf8_general_ci';
$db['oracle']['swap_pre'] = '';
$db['oracle']['autoinit'] = TRUE;
$db['oracle']['stricton'] = FALSE;

请不要将其标记为重复我还没有在这里找到其他问题的解决方案。我尝试引用一些链接,但仍然无法正常工作。

输出:

未找到

在此服务器上找不到请求的 URL/testing/index。

Apache/2.2.3 (CentOS) 服务器在 192.168.0.112 端口 80

最佳答案

改变自

$config['base_url']    = 'http://192.168.0.112/testing/';

$config['base_url'] = (isset($_SERVER['HTTPS']) ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])) . '/';

$config['base_path'] = $_SERVER['DOCUMENT_ROOT'] . preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])) . '/';

也从

$active_group = 'oracle';
$active_record = TRUE;

$tnsname = '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.112)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))';
//112
$db['oracle']['hostname'] = $tnsname;
$db['oracle']['username'] = 'sample';
$db['oracle']['password'] = 'samplepass';
$db['oracle']['database'] = 'test';

$db['oracle']['dbdriver'] = 'oci8';
$db['oracle']['dbprefix'] = '';
$db['oracle']['pconnect'] = TRUE;
$db['oracle']['db_debug'] = TRUE;
$db['oracle']['cache_on'] = FALSE;
$db['oracle']['cachedir'] = '';
$db['oracle']['char_set'] = 'utf8';
$db['oracle']['dbcollat'] = 'utf8_general_ci';
$db['oracle']['swap_pre'] = '';
$db['oracle']['autoinit'] = TRUE;
$db['oracle']['stricton'] = FALSE;

$active_group = 'default';
$active_record = TRUE;

//112
$db['default']['hostname'] = 192.168.0.112;
$db['default']['username'] = 'sample';
$db['default']['password'] = 'samplepass';
$db['default']['database'] = 'test';

$db['default']['dbdriver'] = 'oci8';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

关于php - 需要帮忙!我无法使用 codeigniter 在 oracle 11g 中连接我的程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35473954/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com