Home  >  Article  >  Backend Development  >  How to publish php website

How to publish php website

王林
王林Original
2019-09-18 17:56:087840browse

How to publish php website

Steps to publish PHP website

1. Export database file

Log in to www. phpmyadmin.com

Select the database that needs to be exported, click "Export", select "Custom", select the table that needs to be exported, select "utf-8" for the file character set, click "Execute" to generate the database file

2. Upload database file

1》Log in to the host management console https://cp.aliyun.com/login;

2》 Click "Database Information", select "Management"

3》Click "Import", "New Task", select the newly generated database file with the suffix .sql, and click "Start"

3. Modify the config.php configuration file

Original code:

<?php
//配置文件
return array(
"host" => "localhost",
"user" => "root",
"password" => "123",
"dbname" => "wuyecms",
"port" => 3306,
"charset" => "utf8",
"prefix" => "wy_"
);

Since you use your own computer as the host during the development stage, you need to add the system file to The configuration information for connecting to the database is modified according to your own database information and is modified as follows:

<?php
//配置文件
return array(
"host" => "XXXXXX",//数据库链接地址
"user" => "XXXXXX",//数据库用户名
"password" => "XXXXXX",//数据库管理密码
"dbname" => "XXXXXXX",//数据库名称
"port" => 3306,
"charset" => "utf8",
"prefix" => "wy_"
);

4. Upload website

First, you need to compress the file. The compression method is as follows:

4-1. Enter the source code folder, select all files and folders, and select Add to compressed file.
Tip: The advantage of selecting all files instead of selecting the upper-level folder and then packaging is that the final decompression is directly the source file without the upper-level folder. To use a Windows system virtual host, it needs to be compressed into a .rar format. When using a virtual host on a Linux system, it needs to be compressed into a .zip format.

How to publish php website

5. Upload files

Use FTP client Upload files without operating system restrictions and is applicable to a wide range of applications.

Recommended tutorial: PHP video tutorial

The above is the detailed content of How to publish php website. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn