X6cms deployment in the BAE Process

Source: Internet
Author: User

In the early stage, we won't talk about creating applications and deploying code for Bae.


Ci uri Problems

The first problem isUri design defects of CiAs a result, the Controller and method cannot be correctly found on the Bae. Therefore, we need to change it to the query string format.

First, go to config. in the PHP file, set $ config ['Enable _ query_strings '] to true, but this is not enough because x6cms did not consider this form at the beginning of the design, however, you cannot modify each sentence on each page. Fortunately, x6cms adds its own method site_aurl () in url_helper.php, which is specially used by the background controller.

if ( ! function_exists(‘site_aurl‘)){function site_aurl($uri = ‘‘){$CI =& get_instance();$config = $CI->config->config;$uriarr = explode("/",$uri);// if(empty($uriarr[1])){// $uri_n = "c=".$uriarr[0]."&m=index";// }else{// $uri_n = "c=".$uriarr[0]."&m=".$uriarr[1];// }$uri_n = (empty($uriarr[0])?"":"&c=".$uriarr[0]).(empty($uriarr[1])?"":"&m=".$uriarr[1]);return $CI->config->base_url(‘index.php?d=‘.$config[‘admin_folder‘].$uri_n);}}

Here I modified it. The original $ URI is in the form of main/Hello, the controller is in front of/, and the method is in the back, here we will construct the c = Main & M = Hello query string form by ourselves (the late night spirit is not very good, the code is generally written, and there will be time to optimize it tomorrow)

So far, this problem has been solved perfectly ~


Bae MySQL cannot support PHP serialization perfectly

We entered the background with great enthusiasm, but we found that it was still 404! Open F12 and check out an http: // yourwebsite/index. php? D = Admin web page requests cannot be found after repeat, and then compare with the local ones, it is found that the request is read from the user group permissions, open the table of the user group and find that there are two more local comparisons between the data in the table and the BAE database. Originally, Bae MySQL does not seem to support the PHP serialization format very well. inserting it directly will report an unsupport SQL statement. This is a little troublesome. After all, the database is not around, so it cannot provide timely care and care. After inserting the local data several times, it is still not inserted into the BAE library, in desperation, I took the serialized content for JSON formatting and was inserted into it!

Since the JSON format can be inserted, the next step is simple, in purview_model.php, The getpurview method is used to remove spaces for $ row ['purview'] to replace line characters ~ Reserialize ~ Success ~ (The code here is very simple and will not be pasted)


So far, the x6cms background has been able to run on my Bae, but there must be address issues at the front-end. Change the address tomorrow ~

(Writing in the middle of the night is messy ~ Sort it out when you are free ~)

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.