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

How to build Discuz on Sina SAE application platform! Forum

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces the knowledge of "how to build Discuz! forum on Sina SAE application platform". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, sae and Discuz! A brief introduction to

Sae does not support IO operations, and the code directory cannot be written. This means that ordinary program upload pictures, generate cache and other operations can not work on SAE, when you need to modify the code to make your program run on SAE.

Why does sae disable IO write operations

SAE is designed with a distributed architecture, and the application code will be deployed on multiple front-end servers, and each access request may reach a different server. (as shown below):

Suppose there are four servers A, B, C, and D. The user uploads a picture to the A server, and the second access request may reach the B server, and the picture saved on the A server will not be available at this time.

SAE uses storage services such as MemcacheX and Storage to replace traditional IO operations, which is more efficient than traditional IO read and write operations, and effectively solves the problem of poor program performance caused by IO bottleneck.

Discuz! On the other hand, the process control of discuz looks something like this:

Backstage flow programming: all functions in the DZ background need to be registered in the admincp.php file, and each function has at least one or more Action (actions). In admincp.php, you can define the execution permissions of the Action, which are: "admin==1" administrator, or "admin==2 | | admin==3" super moderator and moderator. Each Action corresponds to a script file, which is named action.inc.php (* .inc.php). And store it in the admin directory. For example, execute: admincp.php?action=dodo, which is equivalent to executing the dodo.inc.php file in the admin directory

Front desk process control: the front desk process control is relatively simple: the process is free, home page index.php, member registration register.php, member login logging.php, posting program post.php, member information: member.php, etc., not listed here.

Discuz! The display layer is what we usually see as the style of the website. Each set of style files in DZ corresponds to a storage directory of style files under templates and images respectively. For the production of website style, please refer to the detailed DZ style production documentation.

The principle of DZ website style file processing is actually very simple, DZ uses parse_template () in template.func.php to PHP regular operation to convert the template tags in the htm module file into PHP code, and save it under forumdata/templates according to styleid, which is a bit like the technology in Smarty.

2. Detailed explanation of discuz installation

Here's how to install discuz on sae.

1 SAE environment configuration

1.1 create an application

Of course, you need to create a new application under Sina SAE before uploading.

Since the website you created is under Sina SAE, you are using the secondary domain name of sinaapp.com. You can mainly write down the name of the secondary domain name and the application name in the SAE background.

1.2 initialize the database

Log in to your SAE application management background, click mysql, and initialize the database.

1.3 enable Memcache

Just turn on memcache,10M.

1.4 create Storage

Create a storage named discuzx (public, don't create a private domain).

2 upload code

Log in to your SAE App Management backend and click "Code Management" to create a new version.

When the upload code box appears, just select the code package to upload, and you will have to wait for a while.

3 DiscuzedX installation

3.1 installation

Visit the installation link http://appname.sinaapp.com/install/ and change appname to the prefix of your secondary domain name. What I just built is luntan123, so continue typing

Just install http://luntan123.sinaapp.com/install/.

During the installation process, ignore the prompt that the environment does not support it and proceed directly to the next step. Just fill in your user name and password, and there is no need to modify the configuration of the database information (it is recommended that you do not modify the table prefix, as there are many subsequent operations that require default prefixes).

Click I agree, click next, select the default "New install Discuz! X (including UCenter Server)" and continue to click next.

Is to install the database, are default, you mainly fill in the system information email, administrator email, do not write these two items must be written, otherwise can not be installed, administrator account directly use the default admin on the line, set and confirm your password, click next

And then your Discuz! X2 forum is installed successfully. This is the address to do http://luntan123.sinaapp.com/. Of course, after the installation, be sure to delete the index.php file under the install directory file through SDK.

3.2 update cache

Operation procedure: tool-"update cache -" to determine.

3.3.Execute uploadimg.php to upload pictures of discuzx to storage

You can upload pictures to storage by visiting the uploadimg.php of the root directory. The reason is that the css cache files used by discuzx are stored on storage, while the images in css use relative paths, so the pictures need to be uploaded to storage. The uploadimg.php file can be deleted after one execution.

If you do not do this, there will be style missing pictures on the foreground page. After it is finished, it can be beautifully displayed.

This is the end of the content of "how to build Discuz! forum on Sina SAE application platform". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Servers

Wechat

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

12
Report