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 configure php service on CVM ecs

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

How to configure php service on CVM ecs? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

When a CVM wants to configure a php environment, different systems operate in different ways. Join the manual construction of the PHP environment under the Windows operating system, and we use the combination of the php5.6+MySQL5.6+Apache2.4 version to briefly introduce the environment construction.

The main process is as follows: ① downloads PHP, MySQL and Apache software; ② installs MySQL database; ③ installs and configures Apache server; ④ configures PHP module to Apache server; ⑤ configures MySQL. Here are the key steps.

About installing the MySQL database

1. Decompress it and put it in a custom directory

2. Rename the my-default.ini in the directory to my.ini

3. Copy the contents below and paste and replace all the contents in my.ini.

[client] port=3306default-character-set=utf8# client character type, which is consistent with the server side. It is recommended that UTF8 [mysqld] port=3306character_set_server=utf8# server character type It is recommended that utf8basedir=D:\ LAMP\ mysql-5.6.17-winx64# extract the root directory datadir=D:\ LAMP\ mysql-5.6.17-winx64\ data# extract the root directory\ datasql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_ tables [WinMySQLAdmin] D:\ LAMP\ mysql-5.6.17-winx64\ bin\ mysqld.exe# extract the root directory\ bin\ mysqld.exe

Note:

Sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

This sentence means that one of the columns adds empty data, cannot use the "method", and must be written to NULL without quotation marks.

4. Configuration of environment variables

My computer-Properties-Advanced-Environment variables-New

Variable MYSQL_HOME, value D:LAMPmysql-5.6.17-winx64

Find the variable path editor and add;% MYSQL_HOME%bin at the end

5. Run the mysqld-install command to install

Open cdm (run enter cmd, or open C:WindowsSystem32cmd.exe)

Go to the bin directory of the MySQL directory and execute the command mysqld-install as follows:

C:\ > cd LAMPD:\ LAMP > cd mysql-5.6.17-winx64D:\ LAMP\ mysql-5.6.17-winx64 > cd binD:\ LAMP\ mysql-5.6.17-winx64\ bin > D:\ LAMP\ mysql-5.6.17-winx64\ bin > mysqld-install

Hint: Service successfully installed. Indicates that the installation was successful. Now that MySQL is installed, you need to configure the development environment.

Installation and configuration of Apache

1. Extract Apache to a custom directory. The directory of this article is the AMP directory under D disk.

2. Open the httpd.conf file in the conf directory under the Apache directory

3. Find c:Apache24 and replace it with your own unzipped directory and replace all

4. Open cmd and execute the installation command httpd-k install

Hint: pache2.4:Service is already installed. Indicates that Apache has been installed successfully

5. Start the Apache service, open ApacheMonitor.exe in the Apache bin directory, and click "Start"

6. Enter localhost in the browser and see It works! Indicates that the installation is successful

The default site root directory for Apache is htdocs, which is the root directory where the php files run, and all php files should be run under the htdocs directory.

After MySQL is configured, the PHP environment under the Windows system is completed. The CVM is easy to operate and easy to manage. The easy-to-use control panel can reinstall the system, change lines, restore backup, restart, and configure FTP, IIS and so on with one click.

This is the answer to the question about how to configure php service on CVM ecs. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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: 245

*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

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report