PHP course 1

Source: Internet
Author: User

Introduction: This is the details page of the first PHP course. It introduces the related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 342153 'rolling = 'no'>

1.1 PHP Overview

To put it simply, the origin of PHP is a tough guy who wrote something fresh in his time. This stuff is used to parse HTML and other things and collect statistics on data access gadgets. Then, there are quite a few people interested in it, because there are few such things, and then they developed into such a large development language.

However, it is generally considered that PhP4 is the official release version of this language.
Several core changes of PhP4:
1. improve resource processing
2. Support for Object-Oriented (possibly pseudo object-oriented)
3. built-in session Processing
4. Introduction of the encrypted Library
5. ISAPI support means that PHP can be installed on Microsoft's IIS
6. built-in support for COM/DCOM and enhanced windows interoperability
7. built-in Java support and support for PHPProgramBinding Java objects
8. Perl-Compatible Regular Expression Library, because Perl's regular expression is awesome. I don't know how awesome it is.
PhP5 goes one step further:
1. The object-oriented feature is greatly added, which facilitates framework development and does not allow programming without objects. Now, yes.
2. Add the try/catch exception handling mechanism.
3. Improved XML processing and Web Service Function Addition
4. the built-in addition of the SQLite database seems to be very popular now.
PhP6 Bucket
1. Unicode is not supported in versions earlier than half a day. The response is a little slow.
2. Security improvement, as if the previous PHP was not secure?
3. New language features, such as 64-bit integer and multi-dimensional array foreach loop transformation. Support for label break.

1.2 general language features

1. practicality. True, the biggest feature of the PHP language does not require any complicated process, such as <? PHP echo date ("f j, Y") ;?> This is the date output format similar to September 23,201 1
2. compact, $ radomstring = substr (MD5 (microtime (), 0, 5); this row outputs a random number of five. In fact, to put it bluntly, it is nested functions, but it is also different from function nesting in other languages. It will be explained later.
3. Loose. To put it simply, variables are made at will, and variables are not declared, used up, or managed, and there is no type. In short, things that you don't need to care about are casual.

1.3 powerful functionsProgramming LanguageIt will be powerful to itself.

At the beginning, PHP has more than 180 available libraries and more than 1000 features. The statistics are really detailed in j8.

Some functions that may not be known: Creating and processing flash, images and PDF files, logon credential verification, multi-protocol channels: LDAP, IMAP, POP3, nntp, DNS, etc, I don't know much about this. Just look at it. After several years of practice, I will explain this stuff in detail.

2.1 installation environment Configuration

If you do not want to know how to manually configure these items, you can submit them to the space service provider for such "low-level" tasks. If you want to quickly build a development environment, XAMPP may be a good choice. This is an integrated package of several programs, including Apache, PHP, Perl, and MySQL. It is very easy to install with a single click.

Here I will mainly talk about manual installation and precautions.
1. You want to download Apache, Xiami? I don't know what Apache does? What does IIS do? You know, they all inherit from Web servers. Source code and binary code are available. If you need to use the source code for compilation, download the binary code and install it directly.
2. Download PHP. Needless to say, the runtime environment of the PHP program. Without him, the computer does not know the PHP you wrote.Code. The installation package and source code are also available. We recommend that you install the package directly because zookeeper is quite lazy like everyone else.
3. Get the document. This document is more professional than any tutorial. You can find the Chinese manuals of PHP and Apache. The male logo in English is very confused.

2.2 Installation

If you are still configuring lamp in windows, we recommend that you install virtualbox to virtualize the Linux environment and configure the environment in both environments, so that you are fully qualified, I think it is no harm for you to learn more about Linux. I am also updating the Linux tutorial. If you are interested, please take a look.

To configure an environment and download PHP

Download Apache

It seems that only the source code is installed.

Decompress Apache
%> Gunzip http-2_x_xx.tar.gz
%> Tar xvf http-2_x_xx.tar

Decompress PHP
%> Gunzip php_xx.tar.gz
%> Tar xvf php_x_xx.tar

This operation will decompress two corresponding folders under the current directory. The specific commands do not need to be entangled. We are not discussing the liunx class here.

Configure and construct Apache

%> Cd http-2_x_xx (entering directory)
%>. /Configure -- enable-So (enable the sharing module. The so-called sharing module means that various modules can be installed in Apache to enhance functions, and PHP is also one of the modules. Therefore, if the sharing module is not started, it is a floating cloud)
%> Make (start building)
%> Make install (installation)

Configuring and building PHP is also a truth.

%> Cd php-x_xx (entering directory)
%>./Configure -- with-apxs2 =/usr/local/apache2/bin/apxs (this is the default installation directory for Apache)
%> Make (start building)
%> Make install (installation)

The guest is a success here. Basically, there will be no problem. Of course, you must have the gun GCC compiler in Linux to makeSource codeAnd Perl is required to run the apxs script to integrate PHP, apache2, and cent os6 Linux of the wretched men's wear. These things can be configured with their own during installation.

By the way, the configuration time is still a little long, and various snacks and seeds are ready.

After the installation is complete, it is the configuration problem. php comes with a configuration file, PHP. ini. Note that its original name is Php. ini-Dist. Copy the file to the specified location and rename it to PhP. ini. The location of this file is actually arbitrary, then you need -- with-apxs2 =/usr/local/apache2/bin/apxs option to configure PHP, you should study it yourself. Or you need to use the custom configuration path to check the relevant information and write down everything. I told you that it is impossible.

It is worth noting that there is a non-standard PHP configuration file PHP. ini-recommended: This file may be incompatible with the previous programs. If you want to use this file, replace the original configuration file.
%> Cp php. ini-recommended/usr/local/lib/PHP. ini

After that, check whether the Apache configuration file has PHP module calls.

An error occurred. The automatically generated PHP module configuration is not found in the Apache configuration file.
Loadmodule php5-module modules/
Addtype application/X-httpd-PHP. PHP (here. PHP maps to this module for processing. This is similar to the asapi competition in IIS. You can specify. HTML. rrrr. if any suffix like ZZ is used, requests that end with the file format will be sent to the PHP module for processing, if you need PHP to process static files, performance loss will occur, so please note that)
The "%> Find/-name" file cannot be found. This is the case of Shenma. This file went there. I have been working on it for two hours. There is nothing other than a word to express the mood of the male !!!

I made it again. I don't know why is stored in the/usr/local/apache2/modules/file again, but a new error occurs, it's planted here today.

It was said that Shenma could not recognize the symbols. After searching for a long time on the Internet, it was said that it was about to install bison, But there was bison in the computer. Okay, I have reinstalled it and Linux has won.

Re-installed %> Yum reinstall bison. I didn't want to know about it either. I'm a little convinced. Installed, new error

I can't change the host name because the host name is missing. According to the methods on Baidu, the hacker still shows the bird, but it does not affect the website. I will check the configuration later, I cannot understand it, but it is estimated that the service operation will not be affected.

Well, this is the time. It has been a long time.

Love J2EE follow Java Michael Jackson video station JSON online tools

Http:// pageno: 6.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.