Table of Contents
The PHP we learned together in those years (1), learning PHP (
Home Backend Development PHP Tutorial PHP we learned together in those years (1), learn PHP (_PHP tutorial

PHP we learned together in those years (1), learn PHP (_PHP tutorial

Jul 12, 2016 am 08:57 AM

The PHP we learned together in those years (1), learning PHP (

PHP is the abbreviation of the English hypertext preprocessing language Hypertext Preprocessor. PHP is an HTML embedded The language is a scripting language that is embedded in HTML documents and is executed on the server side. The language style is similar to the C language and is widely used. Since the creation of the PHP language in 1994, it has been miraculously sought after as the first choice for website design. Language. The release of PHP 4.0 in 2000 undoubtedly injected new life into it, and it was also respected for its open source mentality. Learning the programming language is nothing more than learning some syntax and basic application examples. Record the PHP process step by step, firstly, to summarize yourself, and secondly, to help future learners who encounter the same problem

.

Note-taking is mainly in the form of questions. It will not explore the basics of language bit by bit like a book-based class. Mainly in the basic stage of PHP learning, the problems are foreseen and solved one by one, recorded, and the process of never understanding the solution is recorded. Well that's where the real PHP language begins.

1): What kind of development environment and development tools does PHP need?

Regarding the PHP language version issue, it is necessary to understand it, but I think it doesn’t matter much. Baidu/google can find these development version issues. If a worker wants to do his job well, he must choose a sharp tool! The first time is to configure the development environment. The development environment I first came into contact with was windows, but this time I am willing to conduct subsequent studies on Linux. Now I will show the deployment of both development environments once.

2): What are the steps for windows installation? What aspects need to be paid attention to? ​

The first is windows. Generally, for convenience, you will choose to install a tool suite on windows. Here I use WampServer for development. Wamp is the Windows Apache Mysql PHP integrated installation environment, that is, apache, php and mysql under windows. Server software. Simple one-click installation and deployment of servers, databases, etc. without having to think too much. You can proceed directly to the next step. However, please pay attention to the following points during the installation process:

1. The path where the WAMPSERVER program is located cannot contain Chinese characters and spaces.

2, mysql default user name: root, the password is empty

3, mysql database file storage directory: wampbinmysqlmysql5.5.8data

                                            4. Website root directory [HTML, PHP]wampwww

5. Visit this machine, please use http://127.0.0.1/ (if port 80 is not occupied)

6. Non -default port, the URL is http://127.0.0.1: port/

If an IIS server is installed, port 80 is occupied by default. You need to change the wamp service Internet port number: There is a Listen node with the file httpd.conf in the C:wampbinapacheApache2.2.17conf folder. Modify the port number 80, or you required. After modification, restart all services and run them.

Development tools: PHP Development tools: Zend Stodio, PHPedit, EditPlus 2, easyeclipse, DW, etc. can be completed. As an inherited development tool, Zend is easier to use.

3): Is the installation package deployment environment also in the Linux environment? Is there a graphical management interface?

However, we can still develop PHP on Linux. The development environment I choose here is LAMP (linux Apache Mysql PHP). I use the Ubuntu distribution version as an example to install the development environment. The Apache official website card can download the offline installation package or install it online. It is more convenient to choose online installation here. First use the Ubuntu system and enter the window command (Ctrl Alt t)

  Apache installation
As a powerful Web program, Apache is naturally the first choice for building a Web server. Well, let’s install Apache. Enter the following command in the terminal:
sudo apt-get install apache2
After the installation is completed, the next step is to start Apache
sudo /etc/init.d/apache2 restart
Browse Enter http://localhost or http://127.0.0.1 into the server. If you see "It works!", it means that Apache is successfully installed. The default installation of Apache will create a name under /var. It is the directory of www. This is the Web directory. All Web files that need to be accessible through the browser must be placed in this directory.
Installation of PHP
Installing software under Ubuntu is a very simple matter. It only requires one command. Execute the following command in the terminal:
sudo apt- get install libapache2-mod-php5 php5
After installation, we need to restart Apache and let it load the PHP module:
sudo /etc/init.d/apache2 restart
Next, we will Create a new PHP file under the directory to test whether PHP can run normally. Command:
sudo gedit /var/www/phpinfo.php
Then enter:
(Note: Replace bloginfo with phpinfo when using it. Due to server restrictions, the phpinfo function cannot be used)
Then save the file and enter http://127.0.0.1/phpinfo.php in the browser. If a display appears PHP running parameters page, it means that PHP is running normally.

But if the page is not displayed, but you are prompted to download the file, it means that Apaceh has not loaded the PHP module correctly. The solution is to add it to /etc/apache2/apache2.conf or Add the following line of command to the /etc/apache2/mods-enabled/php5.conf file:
AddType application/x-httpd-php .php .phtml .php3
After adding the above command, pass the following The command should restart Apaceh and the problem should be solved:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart

There is a situation where the expected page does not appear. It may be that the folder www does not have appropriate access permissions. You can change the permissions of the www folder through sudo chmod x ./www. (Those who are familiar with Linux permission management should know this)
 MySQL installation
sudo apt-get install mysql-server
At the end of the installation, it will ask you to enter the root password , note that the root password here is not the Ubuntu root password, it is the root password you want to set for MySQL. Of course, if you are willing, you can set it to the same value. Because it is mainly used for local testing, MySQL has been installed here. If it is really going to be used as a server, you may need to refer to other settings. As for these settings, I will use them later. written down.

Okay, the installation of the development environment is over, let’s wait to write a program that complies with the rules!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1108858.htmlTechArticleThe PHP we learned together in those years (1), learn PHP (PHP, is the English hypertext preprocessing language Hypertext Preprocessor The abbreviation of PHP is an HTML embedded language, a service...
Statement of this Website
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

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 Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1669
14
PHP Tutorial
1273
29
C# Tutorial
1256
24
Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

How does PHP type hinting work, including scalar types, return types, union types, and nullable types? How does PHP type hinting work, including scalar types, return types, union types, and nullable types? Apr 17, 2025 am 12:25 AM

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.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

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.

How do you prevent SQL Injection in PHP? (Prepared statements, PDO) How do you prevent SQL Injection in PHP? (Prepared statements, PDO) Apr 15, 2025 am 12:15 AM

Using preprocessing statements and PDO in PHP can effectively prevent SQL injection attacks. 1) Use PDO to connect to the database and set the error mode. 2) Create preprocessing statements through the prepare method and pass data using placeholders and execute methods. 3) Process query results and ensure the security and performance of the code.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

See all articles