Home  >  Article  >  Backend Development  >  How to remotely deploy php projects

How to remotely deploy php projects

藏色散人
藏色散人Original
2022-01-27 09:28:111598browse

Methods for remote deployment of PHP projects: 1. Rent a server; 2. Configure the environment; 3. Test PHP and database environments; 4. Upload files through WINScp; 5. Run the files.

How to remotely deploy php projects

## Operating environment for this article: Windows 7 system, PHP version 7.1 , DELL G3 computer

How to remotely deploy php projects?

Deploy the PHP project to the server

The project includes a bunch of php files and needs to be connected to mysql

Process

Rent a server-> Configure environment-> Test PHP and database environment-> Upload files-> Run


1. Rent a server
Steps:

Alibaba Cloud Official website registration and login - Real-name authentication - Student authentication - Purchase - Enter >Console>Cloud Server>Instance - Reset instance password -> Configure environment

/


About purchasing
Alibaba Cloud Student Machine: 10rmb per month
*But the discount is only once, so buy it for a few more months (sigh.jpg
Region: You can select a few more to see. The remaining server operating systems (inventory) seem to be different in different regions
Instance: Default 1CPU 2G
operating system: Ubuntu 18.04 64-bit
*The operating system is Linux. If you don’t know Linux instructions, you can only copy other people’s code like crazy/

About reset Password
Instance not found: Note that in the upper left corner of the page, select the region where the server you purchased is located Remember the
ip address,user Name and password , it is best to save them in a txt /

2. Configure the environment
Use the Alibaba Cloud platform’s own Remote connection function

Steps:

(continued from the previous step) - Select and click to enter the purchased instance - Remote connection drop-down selection workbench - The remote connection page pops up - Enter the user name (default root) and password

*Is there a remote connection password here? You need to set it yourself

/


Specific instructions for configuring the environment: Reference : Deploy the PHP project to the server and let others see your results.
/

Hundreds of unexpected situations that have occurred
unable to locate package : Just update/change a command
The root directory var>www>html does not exist: Create a new one yourself, all project files will be placed here
Port :Add mysql port by yourself [Pull down the More drop-down menu on the right side of the instance>Network and Security Group>Configuration Rules>Manual Add>
Custom UDP Purpose: 3306/3306 Source: 0.0.0.0 /0

*There are many accidents and I forgot the details /


3. Test
Steps:

Test the opening of the input ip address - test the status of php and mysql

Test whether php and mysql are available:

Place the php file in the root directory
phpInfo.php[The content is phpInfo();] Open http://ip address/phpInfo.php

4. WINScp upload file
Download winscp - connect with ip address, username, password - upload the file to

\var\www\html (self-search for winscp tutorial)

*winscp is opened by default The directory is \root. You need to return to the top directory \ and find \var\www\html *Generally
\varExists, there is no \var\www, you can create a new www

/


Database encountered a problem: The connection to the mysql database here is through http://ip address/phpmyadmin, which is different from the local test database. You need to

    re-upload the mysql table and data
  • reset phpmyadmin Username and password
  • Change the config of the project connection database (new username and password)
  • /

ps: * Why is Alibaba Cloud's webpage so cluttered when it opens?

Recommended learning: "

PHP Video Tutorial"

The above is the detailed content of How to remotely deploy php projects. 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