This article describes how to build and install a non-integrated php runtime environment (Apache configuration, Mysql, interested friends can refer to this article to share with you the php runtime environment installation text tutorial, for your reference, the specific content is as follows
Install apache:
1. do not install it in a directory with Chinese characters:
2. install apache, php, and mysql in a directory to facilitate management.
3. try to delete the previously installed amp integrated installation environment and delete the configured environment variables:
This is the server name setting. you can enter the server name at will and use the IP address or localhost to access the server,
Enter the email address as needed to ensure that the email address format is correct.
The default homepage (site) after apache installation is:
Apache installation location/htdocs/
Localhost: a special domain name (site), which itself represents a "local server"
127.0.0.1 is a special IP address, representing the "local server"
Enter localhost,
Configure apache to run php web pages
After the initial installation of apache, the configuration item cannot run the php script (code ).
We need to customize apache configuration to achieve this goal: run the php script.
Location of the apache configuration file:
Apche installation directory/conf/
The main configuration file is httpd. conf.
Apache functions are run in a "modular" manner, with many default functional modules
So, php is actually one of the functional modules of apache!
But we have to configure it by ourselves (no default configuration code ).
The code is as follows:
Find the graph file in the PHP installation directory.
After the configuration file is modified, restart apache.
In step 2, there is another way: the file suffix can be set at will, such as. bc8,. phtml
Configure the basic runtime environment of php
The php configuration file is:
Php language pack/php. ini
In fact, the php initial language pack provides two recommended configuration files:
We only need to modify the suffix of one of them. Rename.
It is important to determine the location of the php configuration file (php. ini:
Use a simple php webpage with only one line of code:
After running, you can see
Therefore, we can specify the location of php. ini in the apache configuration file:
Restart apache and run phpinfo. php. The result is:
Configure the time zone:
Find the configuration line based on the keyword timezone:
Initial:
To:
Configure the database connection mechanism:
Although php is a module of apache, it is called by apache,
However, php, as a complete language pack, contains many "sub-modules.
The module configuration in php is as follows (in the php. ini file ):
Extension: the extension module.
Here, you can easily "open/close" a module.
To connect to the mysql database module, open it:
Actually, it's not enough!
Because we need to specify where the module is located
(Compare the syntax of apache to open the php module:
)
That is, the module location must be specified.
In php, the module location setting is a separate setting item, and all modules are put together:
Change to the following:
Restart apache.
Don't worry, because we haven't installed the database yet.
Install mysql database
Start Installation:
After the installation is complete, if nothing is displayed when you connect to the database again, the connection is successful!
The above is all the content of this article. I hope you will like it.