PHP cannot run without the support of a server. What is a server? In layman's terms, a server software is installed on a computer. This computer can be called a server. The server software and the computer's own operating system are two different things. The computer's own operating system can be Linux, Unix, Windows or MacOS. At the same time, the service software can also be Apache (PHP), Tomcat (java/jsp), IIS (asp).
Recommended courses: PHP Tutorial.
PHP mainly uses the Apache server. The mainstream site construction combination is LAMP (Linux, Apache, MySQL, PHP). The integrated server software under Windows is WAMP (Windows , Apache, MySQL, PHP). In addition, there are some other PHP server software, such as lighttpd in Germany and nginx in Russia.
In my study, I mainly used the Apache server, so here I mainly talk about the download and installation of the Apache service.
(1)apache official website download Apache HTTP Server server
I believe that some friends want to download from the official website when they first use apache server, but facing the official website There are so many projects, images, and directories on the Internet that you may be a little confused. The following are the specific steps:
①Open the apache official website http://www.apache.org/
②Click Download in the upper right corner, the following interface will appear, here are the mirror servers, Just find one, the recommended version is used here.
③A directory list appears. These are apache's project lists. I don't understand why apache browses in this way. It's so ugly.
④Click "httpd", the following interface will appear
⑤Click the red box, the following interface will appear
⑥After entering the following interface , select the first item ApacheHaus, which is a third-party download platform. Downloading independent Apache from its website will be a compressed package. Among the other four, the second one is also an independent Apache download address, and the other three are integrated development environments. The first one I chose.
⑦In the new interface, you will find the words VC9 and VC11. By reading the relevant content, you know that VC9 refers to the code compiled with VS2008, while VC11 is compiled with VS2012, and VS2012 The compiled version cannot be used in Windows XP and Server 2003. For the sake of better compatibility, I chose 32-bit Apache compiled with VC9. I chose to download it here and the download process is complete!
(2) Installation of Apache server
After downloading the Apache server, decompress it.
1. Download the installation package
2. Unzip the file to the directory you want to place it. Here I choose to put it in D:\Apache- 2.4.20 directory.
Note: The name of Apache24 can be changed according to your own situation. I changed it to "Apache" as follows:
(3) Apache server configuration
Open the httpd.conf file (under D:\Apache-2.4.20\Apache\conf, this is mine. If the location is different, then The file location is different)
① Modify the directory location, as shown below: If your port 80 is occupied (you can use the command netstat under cmd -a view), change port 80 to something else and save it.
② Configure and install the main service of Apache. With it, Apache can be started. Open the cmd window and enter: "D:\Apache-2.4.20\Apache\bin\httpd.exe" -k install -n apache, remember to include the quotation marks . The meaning of this command is to install the apache service, name the service as apache (you can also change it to something else), and press Enter.
The service is installed. After completion, it will be automatically tested. If there is a problem, the window will prompt an error. At this time, please troubleshoot according to the error.
Normal installation is completed as shown below:
Among them, Errors reported here must be corrected before the service can be started. Meaning, report here Errors must be corrected before service begins. If not, success.
(4) Starting the Apache server
After configuring the Apache server, we can start the server. There are three ways to start the Apache server under Windows.
1. Start using Windows
Open Computer Management and find the apache service item. After selecting it, right-click to select the corresponding operation (start, stop, restart)
2. Start using the command line
I don’t know why I can’t start using the command line. The screenshot is as follows:
3. Use the Apache server Open your own window
Find ApacheMonitor.exe in the bin directory, open
Double-click to run, an icon will appear in the lower right corner of the desktop, double-click to open the window interface, You will see something like the picture below:
Click start on the left to start the apache service.
Supplementary sentence, it can be seen from this interface that it can manually control the opening and closing of the service. In order to save resources, when shutting down the Apache server, please click "Stop" to shut down the apache service. Of course, this service can also be turned off in Windows System Services (it is recommended to set it to manual).
The following picture shows the status of the service being successfully displayed:
Open the browser and enter http://localhost. If the following picture appears If the interface is displayed, the basic configuration of the Apache server is completed and the apache server is ready to run. More specific configurations need to be understood by the user.
The above is the detailed content of How to install apache. For more information, please follow other related articles on the PHP Chinese website!

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool