Download 7:
$ cd $ mkdir php7test $ cd php7test $ wget http://cn2.php.net/get/php-7.0.7.tar.gz/from/this/mirror $ tar -zxvf php-7.0.7.tar.gz $ cd php-7.0.7
Install some dependencies:
$ yum -y install libjpeg libpng freetype libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel curl-devel libxslt-devel lib2 lib2-devel
Configure configure
$ ./configure --prefix=/data/php7 --with-config-file-path=/data/php7/etc --with-config-file-scan-dir=/data/php7/etc/php.d --with-mcrypt=/usr/include --enable-mysqlnd --with-mysqli --with-pdo-mysql --enable-fpm --with-fpm-user=xxxxxxxxxx --with-fpm-group=xxxxxxxxxx --with-gd --with-iconv --enable-xml --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --with-zlib --enable-bcmath --enable-sockets
Then:
$ make $ make install
After the default installation, you will find There is no php.ini file under /data/php7/etc. Where can I get this? It is available in the source code installation package of php7.
Enter the directory of the source code installation package
$ cd $ cd php7test/php-7.0.7 $ ls
You can see that there are two php.ini-xxx files
$ cp php.ini* /data/php7/etc/ $ cp php.ini-production /data/php7/etc/php.ini
Enable php-fpm
Configure the config file first
$ cd /data/php7/etc $ cp php-fpm.conf.default php-fpm.conf $ cp php-fpm.d/www.conf.default php-fpm.d/www.conf
When ./configure before compilation, we have already determined some configurations, such as the user and user group running fpm, so the default configuration should not be There will be path problems and permission problems.
Get the service loading of php-fpm
We hope to use the operations of service php-fpm start|stop|restart to restart the service, but it is not as complicated as nginx. PHP is compiled well After that, we were provided with a php-fpm program, which did not require me to write and share it anymore. This file is placed in the PHP compiled source code directory:
$ cd $ cd php7test/php-7.0.7/sapi/fpm $ cp init.d.php-fpm /etc/init.d/php-fpm $ chmod +x /etc/init.d/php-fpm $ chkconfig --add php-fpm $ chkconfig php-fpm on
Through the above operation, we can use service php-fpm start to enable php-fpm. Use ps -ef | grep php-fpm to check the process.
Or start php7 by using /data/php7/sbin/php-fpm.
Finish & Success
Recommended tutorial: "PHP7"
The above is the detailed content of The installation and use journey of PHP7 on the development machine. For more information, please follow other related articles on the PHP Chinese website!

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

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.