【发布时间】:2019-11-10 23:23:21
【问题描述】:
您好,我是 CodeIgniter 和 PHP 的新手,我正在尝试第一次设置它,但它给出了以下错误。
我使用了 wammp,我在“www”中有文件夹名称“taxapp” 请帮帮我:
在我的dashboard.php和autoloaded.php和config.php下面
( ! ) 致命错误:未捕获的错误:在第 17 行的 C:\wamp64\www\TaxiApp\application\views\dashboard.php 中调用未定义的函数 base_url() (!) 错误:调用未定义的函数 base_url( ) 在 C:\wamp64\www\TaxiApp\application\views\dashboard.php 第 17 行调用堆栈 #TimeMemoryFunctionLocation 10.0005405632{main}( )...\dashboard.php:0
<!DOCTYPE html>
<?php
ini_set('display_startup_errors', true);
error_reporting(E_ALL);
ini_set('display_errors', true);
?>
<html>
<head>
<meta charset="UTF-8" />
<meta name="google-translate-customization" content="e6d13f48b4352bb5-
f08d3373b31c17a6-g7407ad622769509b-12"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Dashboard - 24/7 Taxi</title>
<!-- bootstrap -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?
>application/views/css/bootstrap/bootstrap.min.css" />
<!-- RTL support - for demo only -->
<script src="<?php echo base_url();?>application/views/js/demo-rtl.js">
</script>
<!--
If you need RTL support just include here RTL CSS file <link
rel="stylesheet" type="text/css" href="css/libs/bootstrap-rtl.min.css" />
And add "rtl" class to <body> element - e.g. <body class="rtl">
-->'
autoloader.php
$autoload['helper'] = array('url');
config.php
$config['base_url'] = 'http://172.20.10.3/TaxiApp/';
【问题讨论】:
-
你能试试这个
$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/TaxiApp';吗? -
@M.Hemant 把这个命令放在哪里? server_name 是什么?
-
在 config.php 中替换为您的行并执行 print_r($config);die;
-
@M.Hemant config.php 或 dashboard.php 中的打印命令?
-
在配置中,并将其与您的旧静态 base_url 进行比较
标签: php codeigniter base-url