php5.6.27 installation tutorial
php5.6.27 installation method: first install the compilation tool, and add the PHP group and user; then install the dependencies, add the expansion package, and update the yum source; then download PHP and unzip it for installation; finally configure PHP.
The operating environment of this article: centos7 system, php5.6.27 version, DELL G3 computer
php5.6.27 installation tutorial
centos7 Compile and install php5.6.27
Install compilation tools
yum -y install gcc gcc-c++
Add php group and user, do not create a home directory , not allowed to log in to the system
#-M, --no-create-home 不创建用户的主目录 #-g, --gid GROUP 新账户主组的名称或 ID #-s, --shell SHELL 新账户的登录 shell groupadd web useradd -M -s /sbin/nologin -g web php
Install dependencies, if there is no libmcrypt libmcrypt-devel mcrypt mhash, add the expansion package and update the yum source
yum -y install epel-release yum -y update yum -y install libmcrypt libmcrypt-devel mcrypt mhash yum -y install libxml2-devel libpng-devel libjpeg-devel zlib bzip2 bzip2-devel \ libtool-ltdl-devel pcre-devel openssl-devel freetype-devel libcurl-devel icu \ perl-libintl postgresql libicu-devel
Download php and decompress
cd /usr/local/src/ wget http://cn2.php.net/distributions/php-5.6.27.tar.gz tar -zxvf php-5.6.27.tar.gz cd php-5.6.27/
Install php
./configure \ --prefix=/usr/local/php5.6.27 \ --with-config-file-path=/usr/local/php5.6.27/etc/ \ --enable-inline-optimization \ --enable-shared \ --enable-opcache \ --enable-fpm \ --with-fpm-user=php \ --with-fpm-group=web \ --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-gettext \ --enable-mbstring \ --with-iconv \ --with-mcrypt \ --with-mhash \ --with-openssl \ --enable-bcmath \ --enable-soap \ --with-libxml-dir \ --enable-pcntl \ --enable-shmop \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-sockets \ --enable-intl \ --with-curl \ --with-zlib \ --enable-zip \ --with-bz2 \ --enable-xml \ --with-pcre-dir \ --with-gd \ --enable-static \ --enable-wddx \ --with-xmlrpc \ --with-libdir=/usr/lib64 \ --with-jpeg-dir=/usr/lib64 \ --with-freetype-dir=/usr/lib64 \ --with-png-dir=/usr/lib64 make && make install
Configure PHP
cp php.ini-development /usr/local/php5.6.27/etc/php.ini cp /usr/local/php5.6.27/etc/php-fpm.conf.default /usr/local/php5.6.27/etc/php-fpm.conf
Create startup
vi /lib/systemd/system/php-fpmd.service
[Unit] Description=The PHP FastCGI Process Manager After=network.target [Service] Type=forking PIDFile=/run/php-fpm.pid ExecStart=/usr/local/php5.6.27/sbin/php-fpm --daemonize -g /run/php-fpm.pid ExecReload=/bin/kill -USR2 $MAINPID ExecStop=/bin/kill -SIGINT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
PS: If yum is installed, the content of the php-fpm.service file
[Unit] Description=The PHP FastCGI Process Manager After=syslog.target network.target [Service] Type=notify PIDFile=/run/php-fpm.pid EnvironmentFile=/etc/sysconfig/php-fpm ExecStart=/usr/sbin/php-fpm --nodaemonize ExecReload=/bin/kill -USR2 $MAINPID PrivateTmp=true [Install]
WantedBy=multi -user.target
Add running permission
chmod +x /lib/systemd/system/php-fpmd.service
Set auto-start at boot
systemctl enable php-fpmd.service
Run
systemctl start php-fpmd.service
Stop
systemctl stop php-fpmd.service
Reload
systemctl daemon-reload
Delete boot
systemctl disable php-fpmd.service
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of php5.6.27 installation tutorial. 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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This article details implementing message queues in PHP using RabbitMQ and Redis. It compares their architectures (AMQP vs. in-memory), features, and reliability mechanisms (confirmations, transactions, persistence). Best practices for design, error

This article examines current PHP coding standards and best practices, focusing on PSR recommendations (PSR-1, PSR-2, PSR-4, PSR-12). It emphasizes improving code readability and maintainability through consistent styling, meaningful naming, and eff

This article details installing and troubleshooting PHP extensions, focusing on PECL. It covers installation steps (finding, downloading/compiling, enabling, restarting the server), troubleshooting techniques (checking logs, verifying installation,

This article explains PHP's Reflection API, enabling runtime inspection and manipulation of classes, methods, and properties. It details common use cases (documentation generation, ORMs, dependency injection) and cautions against performance overhea

PHP 8's JIT compilation enhances performance by compiling frequently executed code into machine code, benefiting applications with heavy computations and reducing execution times.

This article explores strategies for staying current in the PHP ecosystem. It emphasizes utilizing official channels, community forums, conferences, and open-source contributions. The author highlights best resources for learning new features and a

This article explores asynchronous task execution in PHP to enhance web application responsiveness. It details methods like message queues, asynchronous frameworks (ReactPHP, Swoole), and background processes, emphasizing best practices for efficien

This article addresses PHP memory optimization. It details techniques like using appropriate data structures, avoiding unnecessary object creation, and employing efficient algorithms. Common memory leak sources (e.g., unclosed connections, global v
