search
HomeBackend DevelopmentPHP TutorialPHP environment building tutorial-detailed graphic and text explanation

PHP environment building tutorial-detailed graphic and text explanation

Mar 29, 2018 pm 01:34 PM
phpGraphics and textDetailed explanation

This article uses a combination of pictures and text to introduce you in detail about how to build an environment with PHP. It also introduces you to some of the advantages of PHP. Interested friends can refer to it.

PHP environment building tutorial-detailed graphic and text explanation

Related recommendations:

●《The 6 best php environment building tools in 2021 Recommended

●《php environment configuration tutorial: PHP development environment integrated installation and independent installation video tutorial

●《mac php environment setup Tutorial: mac php development environment setup and configuration tutorial

Overview of what is PHP

##PHP( Hypertext Preprocessor (Hypertext Preprocessor) is a server, cross-platform, HTML-embedded scripting language. Its unique syntax mixes the characteristics of C language, Java language and Perl language. It is a widely used open source A multi-purpose scripting language, especially suitable for web development.

PHP is a B/S (Browser/Server, browser/server) architecture and a three-tier structure. After the server is started, users can access it using only a browser without using client software, which not only maintains the graphical user interface, but also greatly reduces the amount of application maintenance.

Advantages of PHP language

PHP originated from free software and open source code. Using PHP to develop Web applications has the following advantages .

High security: PHP is open source software, everyone can see all PHP source code, the way the program code is compiled with Apache makes it The security settings are more flexible. PHP has recognized security properties.

Cross-platform features: PHP supports almost all operating system platforms, and supports multiple web servers such as Apache and IIS.

Supports a wide range of databases: Can operate a variety of mainstream and non-mainstream databases, such as MySQL, Access, SQL Server, Oracle, DB2, etc., among which PHP and MySQL is currently the best combination, and their combination can run across platforms.

Easy to learn: PHP is embedded in HTML language, mainly scripting language, with rich built-in functions, simple syntax and easy writing, making it easy for readers to learn and master.

Fast execution speed: It takes up less system resources and the code execution speed is fast.

Free: In the popular enterprise application LAMP platform, Linux, Apache, MySQL, and PHP are all free software. This open source free framework can provide Website operators save a lot of money.

Templating: Realizes the separation of program logic and user interface.

Supports object-oriented and process: Supports two development styles, object-oriented and process, and is backward compatible.

Built-in Zend acceleration engine, stable and fast performance.

New features of PHP5

·Constructor and destructor.

#·Object reference.

#·Clone of the object.

#·Private, public and protected modes in objects.

·interface.

·Abstract class.

·__call.

·__set and __get.

·Static member.

Click here to view the PHP Chinese manual

Using the AppServ combination package under Windows

Combination package is to package Apache, PHP, MySQL and other server software and tools after installation. Developers only need to unzip the configured package to the local hard drive and use it without further configuration. The combination package enables the rapid establishment of a PHP development environment. For programmers who have just started learning PHP, it is recommended to use this method to build a PHP development environment. Although the combination package is much less flexible, it is easy to install, fast and stable, so it is more suitable for beginners.

There are many popular combination packages on the Internet. Here are three recommended combination packages: EasyPHP, AppServ and XAMPP. For novices, it is recommended to use EasyPHP or AppServ, while XAMPP is more complicated.

Click to download the AppServ package:

As shown below:

PHP environment building tutorial-detailed graphic and text explanation

AppSer integrated installation package construction

1. Double-click the AppServ file , open the startup page as shown below:

PHP environment building tutorial-detailed graphic and text explanation

2. Click the Next button to open the AppServ installation agreement page as shown below:

PHP environment building tutorial-detailed graphic and text explanation

3. Click the I Agree button to open the page as shown below. On this page, you can set the installation path of AppServ (the default installation path is generally c:\AppServ). After the AppServ installation is completed, Apache, MySQL, and PHP will be stored in this directory in the form of subdirectories:

PHP environment building tutorial-detailed graphic and text explanation

4. Click the Next button to open the page as shown below, where you can select the programs and components to be installed (the default is all selected):

PHP environment building tutorial-detailed graphic and text explanation

5. Click the Next button to open the page as shown below. This page mainly sets the Apache port number:

The setting of the Apache port number is very important, it directly It is related to whether the Apache server can be started successfully. If port 80 on this machine is occupied by IIS or Thunder, then the server configuration cannot be completed if port 80 is still used here. This problem can be solved by modifying the port number here, or modifying the port number of IIS or Thunder.

PHP environment building tutorial-detailed graphic and text explanation

#6. Click the Next button to open as shown in the figure below. This page mainly sets the login password and character set of the root user of the MySQL database. Here, the character set Set to

"GB2312 Simplified Chinese", which means that the character set of the MySQL database will be in Simplified Chinese form:

PHP environment building tutorial-detailed graphic and text explanation

7. Click the Install button to start the installation. , as shown below:

PHP environment building tutorial-detailed graphic and text explanation

8. The following picture shows the interface after the installation is completed:

PHP environment building tutorial-detailed graphic and text explanation

After installing AppServ, the entire The directory is installed in the "c:AppServ" path by default. This directory contains several subdirectories:

PHP environment building tutorial-detailed graphic and text explanation

Open the browser and enter "http://localhost/" in the address bar [The port number you set, if it is 80, you don’t need to fill it in]". If you open the following picture, it means that the AppServ installation is successful:

PHP environment building tutorial-detailed graphic and text explanation

With the development of PHP, a large number of excellent Development tools have emerged one after another. Finding a tool that suits you will not only speed up your learning progress, but also enable you to discover problems in time during the future development process and avoid detours. The development tool we choose is Dreamweaver. Please refer to the online information for detailed project creation.

Related recommendations:

PHP development kit php7 php environment construction PHP from entry to proficiency

PHP environment construction (php+Apache+ mysql) Detailed introduction

PHP environment construction-WAMP+Zend

The above is the detailed content of PHP environment building tutorial-detailed graphic and text explanation. 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
How can you protect against Cross-Site Scripting (XSS) attacks related to sessions?How can you protect against Cross-Site Scripting (XSS) attacks related to sessions?Apr 23, 2025 am 12:16 AM

To protect the application from session-related XSS attacks, the following measures are required: 1. Set the HttpOnly and Secure flags to protect the session cookies. 2. Export codes for all user inputs. 3. Implement content security policy (CSP) to limit script sources. Through these policies, session-related XSS attacks can be effectively protected and user data can be ensured.

How can you optimize PHP session performance?How can you optimize PHP session performance?Apr 23, 2025 am 12:13 AM

Methods to optimize PHP session performance include: 1. Delay session start, 2. Use database to store sessions, 3. Compress session data, 4. Manage session life cycle, and 5. Implement session sharing. These strategies can significantly improve the efficiency of applications in high concurrency environments.

What is the session.gc_maxlifetime configuration setting?What is the session.gc_maxlifetime configuration setting?Apr 23, 2025 am 12:10 AM

Thesession.gc_maxlifetimesettinginPHPdeterminesthelifespanofsessiondata,setinseconds.1)It'sconfiguredinphp.iniorviaini_set().2)Abalanceisneededtoavoidperformanceissuesandunexpectedlogouts.3)PHP'sgarbagecollectionisprobabilistic,influencedbygc_probabi

How do you configure the session name in PHP?How do you configure the session name in PHP?Apr 23, 2025 am 12:08 AM

In PHP, you can use the session_name() function to configure the session name. The specific steps are as follows: 1. Use the session_name() function to set the session name, such as session_name("my_session"). 2. After setting the session name, call session_start() to start the session. Configuring session names can avoid session data conflicts between multiple applications and enhance security, but pay attention to the uniqueness, security, length and setting timing of session names.

How often should you regenerate session IDs?How often should you regenerate session IDs?Apr 23, 2025 am 12:03 AM

The session ID should be regenerated regularly at login, before sensitive operations, and every 30 minutes. 1. Regenerate the session ID when logging in to prevent session fixed attacks. 2. Regenerate before sensitive operations to improve safety. 3. Regular regeneration reduces long-term utilization risks, but the user experience needs to be weighed.

How do you set the session cookie parameters in PHP?How do you set the session cookie parameters in PHP?Apr 22, 2025 pm 05:33 PM

Setting session cookie parameters in PHP can be achieved through the session_set_cookie_params() function. 1) Use this function to set parameters, such as expiration time, path, domain name, security flag, etc.; 2) Call session_start() to make the parameters take effect; 3) Dynamically adjust parameters according to needs, such as user login status; 4) Pay attention to setting secure and httponly flags to improve security.

What is the main purpose of using sessions in PHP?What is the main purpose of using sessions in PHP?Apr 22, 2025 pm 05:25 PM

The main purpose of using sessions in PHP is to maintain the status of the user between different pages. 1) The session is started through the session_start() function, creating a unique session ID and storing it in the user cookie. 2) Session data is saved on the server, allowing data to be passed between different requests, such as login status and shopping cart content.

How can you share sessions across subdomains?How can you share sessions across subdomains?Apr 22, 2025 pm 05:21 PM

How to share a session between subdomains? Implemented by setting session cookies for common domain names. 1. Set the domain of the session cookie to .example.com on the server side. 2. Choose the appropriate session storage method, such as memory, database or distributed cache. 3. Pass the session ID through cookies, and the server retrieves and updates the session data based on the ID.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

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.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.