Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Deployment method and steps of ThinkPHP in Sina SAE platform

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "the deployment methods and steps of ThinkPHP in Sina SAE platform". In the daily operation, I believe many people have doubts about the deployment methods and steps of ThinkPHP in Sina SAE platform. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "deployment methods and steps of ThinkPHP in Sina SAE platform". Next, please follow the editor to study!

The specific implementation methods are as follows:

ThinkPHP has provided SAE platform support since the thinkphp3.0 version, and has many features to support localized development and debugging as well as deployment switching, making it easy for thinkphper to transition to SAE development.

1. Preparatory work:

1. You need to have a SAE account. If you do not have this account, please apply to the official website of SAE.

2. Develop or find a program based on thinkphp3.12. This test uses the WBlog3.1.3 version of the blog program. If you don't have it, you can download it here.

3. Download the 3.12 version of SAE engine Engine from the ThinkPHP official website and put it in the extension package of the core package. The SAE engine is located in the thinkphp package: ThinkPHP\ Extend\ Engine

Second, the implementation steps:

1. Create an application. The http://127.0.0.1/ is shown in the figure:

2. Create a version. Here we create 1, as shown below:

3. Upload the code package. The complete upload code package is shown in the figure:

4. Create a database. The path to open the database is w3note »MySQL »Service Management »Management MySQL. The database I created is named WBlog, and then import the datasheet sql file

5. Configure the project entry files of the front and background, with more or less the same method. The following is the foreground project entry file index.php configuration

The copy code is as follows:

It seems to have been done here, but also pay attention to the following two points.

1. SAE is strictly case-sensitive

If the Css in the path http://127.0.0.1/Public/Css/style.css is changed to a css style file, it will load an error. However, there was no error in the local test.

2. SAE URL routing Hidden index.php

If you hide index.php in a local URL such as http://127.0.0.1/WBlog/blog, you cannot access it in SAE. The reason is

SAE does not support .htaccess files, but we can implement pseudo-statics using the AppConfig service provided by SAE.

Add the following code to the config.yaml file in the root directory of your project (usually it will be generated automatically, and you can build it if you don't have it):

Handle:

-rewrite: if (! is_dir () & &! is_file () & & path~ "^ (. *) $") goto "index.php/$1"

So you can hide the entrance.

At this point, the study on the "deployment method and steps of ThinkPHP in Sina SAE platform" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report