Configure Discuz based on jetty Fast CGI Proxy and PHP-FPM

Source: Internet
Author: User

Finally put the discuz installed, but after the installation of a large pile of problems found. This picture does not show, the one that cannot be used.

The root of the problem is because I am not a direct PHP access, but through PHP-FPM relay, and Discuz code inside a lot of direct reference to $_server[http_host] Such variables, so many places are localhost:9000 ( That is, the address of the agent)

It takes a couple of steps to solve this problem.

1. Upload/source/class/discuz_application below, search SiteURL, in the initialization SiteURL place, fill in your domain name

2. Refer to Http://blackbap.org/thread-4847-1-1.html

To source\module\misc\misc_seccode.php, find line 94th

Change into

if ($$_g[' setting ' [' Seccodedata '] [' type '] < 2 && ($ $refererhost [' host ']! = ($$_server[' http_x_forwarded_ HOST ']? $$_server[' http_x_forwarded_host ': $$_server[' http_host ')) | | $$_g[' Setting ' [' Seccodedata '] [' type '] = = 2 &&!extension_loaded (' Ming ') && $$_post[' Fromflash ']! = 1 | | $$_g[' Setting ' [' Seccodedata '] [' type '] = = 3 && $$_get[' Fromflash ']! = 1) {

3.

To/source/class/helper/helper_form.php, find Submitcheck

Change into

public static function Submitcheck ($var, $allowget = 0, $seccodecheck = 0, $secqaacheck = 0) {if (!GETGPC ($var)) {return FA LSE;} else {global $_g;if ($allowget | | ($_server[' request_method ') = = ' POST ' &&!empty ($_get[' Formhash ']) && $_get[' formhash '] = = Formhash () & amp;& empty ($_server[' http_x_flash_version ')) && (Empty ($_server[' http_referer ')) | | STRNCMP ($_server[' http_referer '), ' http://wsq.discuz.qq.com ', 24) = = 0 | | STRNCMP ($_server[' http_referer '), ' http://m.wsq.qq.com ', 19) = = 0 | | Preg_replace ("/https?:\ /\/([^\:\/]+). */i "," \\1 ", $_server[' http_referer ']) = = Preg_replace ("/([^\:]+). * * "," \\1 ", $_server[' http_x_ Forwarded_host '])) {if (Checkperm (' Seccode ')) {if ($secqaacheck &&!check_secqaa ($_get[' secanswer '), $_get[ ' Secqaahash ')) {showmessage (' submit_secqaa_invalid ');} if ($seccodecheck &&!check_seccode ($_get[' seccodeverify '), $_get[' Seccodehash '], 0, $_get[' seccodemodid ')) {showmessage (' submit_seccode_invalid ');}} return TRUE;} else {sHowmessage (' Submit_invalid ');}}} 

4.

Below the Upload/uc_server, find the avatar.php,index.php,admin.php below.

Find Uc_api, change the address to the domain you want, and take care not to add "/" at the end.

5.

Login

...../admin.php

And

.../uc_server/admin.php

Change all the places that show localhost to your correct domain name

After the five steps have been done, the Forum will be able to display normally, if there are any problems to continue editing here.

Configure Discuz based on jetty Fast CGI Proxy and PHP-FPM

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.