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 change the website to https by php

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

Share

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

This article is about how php changed its website to https. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Php changes the website to https: 1. Apply for a certificate free of charge in the Aliyun CA certificate; 2. Check the certificate status; 3. Modify the domain name configuration file.

This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer

How does php change the website to https?

Php converts http to https Mini Program deployment online

Wow, I've been working on it for a long time! In fact, it is very simple!

First contact, confused, then suddenly a try on ok, can access https, began to report a lot of errors, such as 502Bad Gateway,404 Not Found and other errors, everyone said it was a configuration problem, Baidu later said that it was a series of problems such as browser, firewall and so on, tried a lot, and then it was not the case, it was not about those things! The following operations hope to be of some help to PHP members. I configure Ubuntu, but they are all operated under Linux. Centos should also be OK! I think java just wrote it into another server! Just go step by step! So it doesn't matter ~ go ahead and try!

1. Go to Aliyun CA certificate to apply for a certificate for free, click complete, and fill in your domain name! To facilitate access by small program numbers, but be sure to tick when filling in personal information, otherwise the review will take a long time and may not be successful! Follow the steps and you can apply.

two。 When passed, its certificate status will become issued, and then click the download on the right to operate https! There are step-by-step tutorials on it, just follow it.

3. Find out the configuration file of your domain name for editing, enter your configuration file for editing (the configuration file here is the location of your domain name profile, regardless of whether you are a first-level domain name or a second-level domain name)

4. In the configuration file, I put ports 80 and 443 together, at first, I rewrote a server below, and wrote the steps of applying for a certificate below. After saving and exiting, I reported a 502 error, otherwise it was a 404 error and the whole skull was big, and then I tried the following method and it was successful.

# nginx-t check whether the configuration is correct

# service nginx restart restart configuration file

5. After configuration, restart, you can access the browser. If you can successfully access the https, you need to enter the merchant's public platform to upload the Mini Program frontend code. Open WeChat Mini Programs editor and click upload

Please note that before uploading, the Mini Program appid must be changed to the merchant's, and then the linked background data address should be changed to the https:// domain name and then uploaded, otherwise there will be no data when the phone scans and logs in.

6. Enter the public platform to log in. After logging in, click the development settings in the settings on the left sidebar to set the server domain name. The domain name is filled in the domain name of your server.

Then the following look at your mood, you can set it if you want to, and then click on the development management, the lowest development version, and first click on the lower left corner of the uploaded project to have an experience version. Please scan and check first and then click to submit for approval. It's done. Let's have a rest.

Expand to see if you have reported the following error!

1. 502 Bad Gateway error

404 Not Found error

It is said that my configuration is wrong so far I still do not know what is wrong, and then I went to see the error log and reported the following error

There is still no way to know what this error is, there is no solution. I was depressed for a long time!

Here is a friend introduction is another way to write, to show you yo ~

And then I can't access the server. You can try. Anyway, I am.

The way JAVA is written is more or less the same (all I have tried)

Thank you for reading! This is the end of the article on "how php changes the website to https". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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