Home Backend Development PHP Tutorial 关于lnmp下搭thinkPHP没法找打指定静态页面(求答案)(急)

关于lnmp下搭thinkPHP没法找打指定静态页面(求答案)(急)

Jun 13, 2016 am 11:47 AM
default gt index nbsp thinkphp

关于lnmp下搭thinkPHP无法找打指定静态页面(求答案)(急)
我在lnmp 下架了一个thinkPHP框架对应的小网站,非常奇怪,在环境都配置好后(配置文件里默认模块是Index,默认方法是index),我在url里输入localhost:10007/index.php/member/login,正常来说应该显示login.html,但是显示的是index.html的页面,只是样式都不对,查看源代码后发现样式路径是这样的,/index.php/index.php/member/index/Tpl/css/style.css,后来我config.php里的配置项改了如下:

'DEFAULT_MODULE'=>'Member', //设置默认的控制器名称
'DEFAULT_ACTION'=>'login', //设置默认的方法名称

又回无论url输入什么都总停留在login.html对应页,但是样式不对,产看原代码后发现样式路径是这样的,/index.php/index.php/index/index/Tpl/css/passport.min.css

总之,好像我的'DEFAULT_MODULE'和'DEFAULT_ACTION'配置项配置成什么,url无论输入什么都回显示与配置文件中默认的模块和方法对应的html文件

 而且,应该也不是框架的问题,我从新下了个最新版本的thinkPHP,也不行,这次连index.html页面也显示不出来
我感觉就是我的那里配置不对,,但是又找不到!!!

主要的目录结构是这样:

App 
      index
             Conf
                   config.php
             Common
             Lang
             Runtime
             Lib
                   Action
                         IndexAction.class.php
                         MemberAction.class.php
             Tpl
                   default
                         Index
                                 index.html
                         Member
                                 login.html
                         js
                         css
                         images
      ThinkPHP  (ThinkPHP框架)
      index.php


index.php内容如下

<?php<br /><br />header("content-type:text/html;charset=utf-8");<br /><br />// 定义ThinkPHP框架路径(相对于入口文件)<br />define('THINK_PATH', './ThinkPHP');<br />    <br />//定义项目名称和路径<br />define('APP_NAME', 'myapp');<br />define('APP_PATH', './index');<br />define('BACK_URL','./index.php');<br /><br />// 加载框架入口文件 <br />require(THINK_PATH."/ThinkPHP.php");<br /><br />//实例化一个网站应用实例<br />App::run();<br /><br />?>
Copy after login

 
config.php页面

<?php <br />return array(<br>    //'配置项'=>'配置值'<br>    'DEFAULT_MODULE'=>'Index',    //设置默认的控制器名称<br>    'DEFAULT_ACTION'=>'index',          //设置默认的方法名称<br>    'APP_DEBUG'=>true,               //开启调试模式<br>    'TMPL_L_DELIM'=> '{{',            // 模板引擎普通标签开始标记<br>    'TMPL_R_DELIM'=> '}}',            // 模板引擎普通标签结束标记<br>    'URL_MODEL'=> 0,<br>    'DB_NAME'=> 'Route',<br>    'DB_PREFIX'=> 'p_',<br>    'TMPL_ENGINE_TYPE'=>'Smarty',<br>    'TOKEN_ON'=>false,<br>    'TOKEN_NAME'=>'__hash__',<br>    'TOKEN_TYPE'=>'md5',<br>    'DB_FIELDTYPE_CHECK'=>false,<br>    'TMPL_ENGINE_CONFIG'=>array(<br>        'caching'=>false,<br>        'template_dir'=>TMPL_PATH,<br>        'compile_dir'=>CACHE_PATH,<br>        'cache_dir'=>TEMP_PATH,<br>        'left_delimiter'=>"{{",<br>        'right_delimiter'=>"}}"<br>    ),<br>    'TMPL_ACTION_ERROR'     => TMPL_PATH.'default/Public/error.html', // 默认错误跳转对应的模板文件<br>    'TMPL_ACTION_SUCCESS'   => TMPL_PATH.'default/Public/success.html',<div class="clear">
                 
              
              
        
            </div>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What file is index.html? What file is index.html? Feb 19, 2024 pm 01:36 PM

index.html represents the home page file of the web page and is the default page of the website. When a user visits a website, the index.html page is usually loaded first. HTML (HypertextMarkupLanguage) is a markup language used to create web pages, and index.html is also an HTML file. It contains the structure and content of a web page, as well as tags and elements used for formatting and layout. Here is an example index.html code: &lt

10 Ways to Adjust Brightness on Windows 11 10 Ways to Adjust Brightness on Windows 11 Dec 18, 2023 pm 02:21 PM

Screen brightness is an integral part of using modern computing devices, especially when you look at the screen for long periods of time. It helps you reduce eye strain, improve legibility, and view content easily and efficiently. However, depending on your settings, it can sometimes be difficult to manage brightness, especially on Windows 11 with the new UI changes. If you're having trouble adjusting brightness, here are all the ways to manage brightness on Windows 11. How to Change Brightness on Windows 11 [10 Ways Explained] Single monitor users can use the following methods to adjust brightness on Windows 11. This includes desktop systems using a single monitor as well as laptops. let's start. Method 1: Use the Action Center The Action Center is accessible

What are the differences between Huawei GT3 Pro and GT4? What are the differences between Huawei GT3 Pro and GT4? Dec 29, 2023 pm 02:27 PM

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

How to run thinkphp project How to run thinkphp project Apr 09, 2024 pm 05:33 PM

To run the ThinkPHP project, you need to: install Composer; use Composer to create the project; enter the project directory and execute php bin/console serve; visit http://localhost:8000 to view the welcome page.

How to turn off private browsing authentication for iPhone in Safari? How to turn off private browsing authentication for iPhone in Safari? Nov 29, 2023 pm 11:21 PM

In iOS 17, Apple introduced several new privacy and security features to its mobile operating system, one of which is the ability to require two-step authentication for private browsing tabs in Safari. Here's how it works and how to turn it off. On an iPhone or iPad running iOS 17 or iPadOS 17, Apple's browser now requires Face ID/Touch ID authentication or a passcode if you have any Private Browsing tab open in Safari and then exit the session or app to access them again. In other words, if someone gets their hands on your iPhone or iPad while it's unlocked, they still won't be able to view your privacy without knowing your passcode

Win10/11 digital activation script MAS version 2.2 re-supports digital activation Win10/11 digital activation script MAS version 2.2 re-supports digital activation Oct 16, 2023 am 08:13 AM

The famous activation script MAS2.2 version supports digital activation again. The method originated from @asdcorp and the team. The MAS author calls it HWID2. Download gatherosstate.exe (not original, modified) from https://github.com/massgravel/Microsoft-Activation-Scripts, run it with parameters, and generate GenuineTicket.xml. First take a look at the original method: gatherosstate.exePfn=xxxxxxx;DownlevelGenuineState=1 and then compare with the latest method: gatheros

There are several versions of thinkphp There are several versions of thinkphp Apr 09, 2024 pm 06:09 PM

ThinkPHP has multiple versions designed for different PHP versions. Major versions include 3.2, 5.0, 5.1, and 6.0, while minor versions are used to fix bugs and provide new features. The latest stable version is ThinkPHP 6.0.16. When choosing a version, consider the PHP version, feature requirements, and community support. It is recommended to use the latest stable version for best performance and support.

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

Steps to run ThinkPHP Framework locally: Download and unzip ThinkPHP Framework to a local directory. Create a virtual host (optional) pointing to the ThinkPHP root directory. Configure database connection parameters. Start the web server. Initialize the ThinkPHP application. Access the ThinkPHP application URL and run it.

See all articles