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!

The article discusses ThinkPHP's built-in testing framework, highlighting its key features like unit and integration testing, and how it enhances application reliability through early bug detection and improved code quality.

Article discusses using ThinkPHP for real-time stock market data feeds, focusing on setup, data accuracy, optimization, and security measures.

The article discusses key considerations for using ThinkPHP in serverless architectures, focusing on performance optimization, stateless design, and security. It highlights benefits like cost efficiency and scalability, but also addresses challenges

The article discusses implementing service discovery and load balancing in ThinkPHP microservices, focusing on setup, best practices, integration methods, and recommended tools.[159 characters]

ThinkPHP's IoC container offers advanced features like lazy loading, contextual binding, and method injection for efficient dependency management in PHP apps.Character count: 159

The article discusses using ThinkPHP to build real-time collaboration tools, focusing on setup, WebSocket integration, and security best practices.

ThinkPHP benefits SaaS apps with its lightweight design, MVC architecture, and extensibility. It enhances scalability, speeds development, and improves security through various features.

The article outlines building a distributed task queue system using ThinkPHP and RabbitMQ, focusing on installation, configuration, task management, and scalability. Key issues include ensuring high availability, avoiding common pitfalls like imprope


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

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft