PHP official website www.php.net
Current mainstream version is 5.6/7.1
One, download the PHP package:
wget http://cn2.php.net/distributions/php-****.tar.gz
Second, unzip the PHP package:
Tar zxf php-****.tar.gz
Into the PHP file
CD php-****
Three, start compiling:
./configure--prefix=/usr/local/php
--with-apxs2=/usr/local/apache2.4/bin/apxs (APXS2 is an Apache tool that puts expanded modules into Apache modules and writes directly to configuration files)
--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP/ETC (Specify the path of the configuration file, php.ini)
--with-mysql=/usr/local/mysql--with-pdo-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config
(three different MySQL drivers, specify the library)
--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir--with-freetype-dir--with-iconv-dir--with-zlib-dir-- with-bz2--with-openssl--with-mcrypt--enable-soap--enable-gd-native-ttf--enable-mbstring--enable-sockets-- Enable-exif
The process of compiling a lot of problems, most of them are installation problems, one solution is good
The last php5 we wanted was in Apache's module.
[Email protected] local]# Du-sh apache2.4/modules/libphp5.so
37Mapache2.4/modules/libphp5.so
PHP-loaded modules are static
Use the/usr/local/php/bin/php-m command to view
PHP is the extension module for httpd existence.
/USR/LOCAL/APACHE2.4/CONF/HTTP.CONF is the Apache configuration file, search inside/php5.so will find a row loadmodule, is the AP2X tool plus
Four, what exactly is mysql,mysqli,mysqlnd,pdo in PHP?
MySQL is also known as the Original MYSQL,PHP4 version of the MySQL extension, which has been discarded since PHP5 and has been removed from PHP7.
Mysqli is called "MySQL Enhanced extensions".
Mysqlnd MySQL NATIVE dirver is called the "official drive" of MySQL or more directly called "Native Drive".
The PDO PHP data Objects PHP object is a Database abstraction layer specification in PHP applications.
One, what is an API?
An application interface (application programming interface abbreviation) that defines the classes, methods, functions, variables, and so on everything in your application that needs to be called in order to complete a particular task. The API required for PHP applications to interact with the database is usually exposed via PHP extensions (called to the terminal PHP programmer). This API is provided by MySQL and mysqli.
Two, what is a driver?
driver is a piece of software code designed to interact with a particular type of database server. The driver may call some libraries, such as the MySQL client library or the MySQL native driver library. These libraries implement the underlying protocol for interacting with the MySQL database server. In the context of PHP expansion, MySQL and mysqli are still relatively upper-level expansion, relying on the bottom of the library to connect and access the database, the above-mentioned MYSQLND is called the underlying database driver.
From the application level, we operate the database through PHP's MySQL or mysqli extension API.
From the ground up, MYSQLND provides support for the underlying and database interactions (which can be easily understood as a network protocol interaction with MySQL server).
PDO, however, provides a unified API interface so that your PHP application does not care about the type of database server system you want to connect to. In other words, if you use the PDO API, you can seamlessly switch the database server whenever you need to. For example Mysql,sqlite any database is OK.
For most functions, the API interface provided by PDO and the interface provided by MYSQLI are consistent with the general effect of adding and deleting.
Five, expand:
View the compiler parameters for Nginx, Apache, MySQL, and PHP:http://ask.apelearn.com/question/1295
Lamp Architecture (PHP installation parsing)