What should I do if I get an error when deploying thinkphp5 in Pagoda?
宝塔部署thinkphp5报错的解决办法:1、打开宝塔服务器,安装php pathinfo扩展并启用;2、配置“.access”文件,内容为“RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]”;3、在网站管理里面,启用thinkphp的伪静态即可。
本教程操作环境:Windows10系统、thinkphp5版、Dell G3电脑。
宝塔部署thinkphp5报错怎么办?
宝塔服务器面板 部署 thinkphp5 坑
thinkphp5 在宝塔服务器上部署,出现的问题:
1. File not found.
原因: 宝塔服务器默认不支持 pathinfo 的路径访问;需要在软件 - PHP - 管理里面,安装php pathinfo 扩展,并启用;
thinkphp 在入口文件同级下,有个 .access 文件,需要配置;官方文档中有说明,但是有个地方是不正确的
正确的配置应该如下:
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L] </IfModule>
特别注意 index.php?s=
这个问题搞了2天,纠结了好久。无意中尝试发现是路径的问题。太坑。
2.网站管理里面,需要启用 thinkphp 的伪静态。
完成上面2步,基本上能解决路径不对的问题。
路径不对,主要还是thinkphp的路由问题,可能版本不一样,都会有所区别。需要具体视情况来分析了。
推荐学习:《PHP视频教程》《thinkPHP视频教程》
The above is the detailed content of What should I do if I get an error when deploying thinkphp5 in Pagoda?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



This article uses the Pagoda Panel Tutorial column to introduce to you the problem that server2022 cannot be remote after installing Pagoda. I wonder if you have encountered such a problem? Let me show you how I handle it!

Pagoda Panel is a very excellent server management panel under Linux system. It has powerful functions and friendly interface, which can help users manage servers easily. In the process of using the Pagoda Panel, it is sometimes necessary to limit the speed of the virtual host to ensure the stability and fluency of the server. This article will introduce how to set the speed limit of the virtual host through the Pagoda panel to achieve a good user experience. 1. Overview of Speed Limit Speed limit refers to limiting the host bandwidth and ensuring the normal operation of the server by controlling the host traffic. exist

Solution to the error reported when deploying thinkphp5 in Pagoda: 1. Open the Pagoda server, install the php pathinfo extension and enable it; 2. Configure the ".access" file with the content "RewriteRule ^(.*)$ index.php?s=/$1 [QSA ,PT,L]”; 3. In website management, just enable thinkphp’s pseudo-static.

With the development and popularization of the Internet, domain names have become an indispensable part of our online world. However, many people are still confused about the settings of domain name resolution. Today, we will introduce how to use the Pagoda panel to set up domain name resolution. What is DNS? Domain name resolution is the process of binding a domain name to the IP address of the website or server it represents. It is a process that converts human-readable domain names into computer-readable IP addresses. The main components of domain name resolution are: domain name registration, DNS resolution and we

Introduction to the WebDAV file management function of Pagoda Panel WebDAV is a file management technology based on the HTTP protocol. It allows users to access files on the network through the HTTP protocol and manage these files. With the support of WebDAV technology, we can build a Web server to provide various network services. Pagoda Panel is a popular web server management tool that provides a wealth of functional modules, among which the WebDAV file management function is one of them. Below, this article

In the current Internet era, websites have become an important means for many companies to display and promote themselves. However, it is inevitable that some unexpected situations will cause the website to be inaccessible or have limited functions. At this time, the website needs to be repaired and maintained. This article will introduce how to use Pagoda Panel for website repair and maintenance. 1. Introduction to Pagoda Panel Pagoda Panel is a website management software running on a Linux server. It can help users quickly build a Web environment on the server operating system. The Pagoda panel integrates numerous functional modules

Solution to the failure of PHP extension installation in Pagoda Panel: 1. Search for "Toolbox" in the software mall; 2. Install the Linux toolbox; 3. Click "Settings" and set the virtual memory to "1224m"; 4. Reinstall it. .

Pagoda Panel is a powerful panel software that can help us quickly deploy, manage and monitor servers, especially small businesses or individual users who often need to build websites, database management and server maintenance. Among these tasks, MySQL database management is an important job in many cases. So how to use the Pagoda panel for MySQL management? Next, we will introduce it step by step. Step 1: Install Pagoda Panel. Before starting to use Pagoda Panel for MySQL management, you first need to install Pagoda Panel.
