Home > Article > Backend Development > How to remotely deploy php projects
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?
Deploy the PHP project to the server
The project includes a bunch of php files and needs to be connected to mysqlProcess Rent a server-> Configure environment-> Test PHP and database environment-> Upload files-> Run Alibaba Cloud Official website registration and login - Real-name authentication - Student authentication - Purchase - Enter >Console>Cloud Server>Instance - Reset instance password -> Configure environment
/2. Configure the environment Use the Alibaba Cloud platform’s own Remote connection functionSteps:
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 Nameand
password, it is best to save them in a txt
/
(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 /
Test the opening of the input ip address - test the status of php and mysql
Test whether php and mysql are available:4. WINScp upload file Download winscp - connect with ip address, username, password - upload the file toPlace the php file in the root directory
phpInfo.php[The content is
phpInfo();]
Open http://ip address/phpInfo.php
\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 tore-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?
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!