How to compile and install php5.6.31
How to compile and install php5.6.31: 1. Add epel source; 2. Install dependencies; 3. Download and decompress php5.6.31; 4. Modify php-fpm.conf; 5. Start php-fpm. Can.
The operating environment of this article: CentOS 7 system, php version: 5.6.31 nginx version: 1.7.3 mysql version: 5.6.62, DELL G3 computer
How to compile and install php5.6.31?
CentOS 7 Compile and install PHP5.6.31:
There are already nginx and mysql on the server, so I decided to use PHP Nginx mysql For this combination, I read a lot of information on the Internet. Since I don’t know much about Linux and PHP, and I don’t know how PHP is related to nginx and mysql, I encountered various reasons (either PHP was installed incorrectly, or the package was not installed), It took a lot of time, but after the deployment, I found that these three are installed separately (well~~ can they be installed together), you only need to configure PHP after installation, and configure nginx (associated with PHP). Ran. As for mysql, as long as it is turned on and the connection database in the php project is configured, you can connect directly. So this article mainly focuses on the installation of php.
Regarding the installation of nginx and mysql, some development libraries for Linux need to be installed before starting the installation. I will not repeat them here. They are all in the reference link.
PHP installation configuration
nginx itself cannot handle PHP. It is just a WEB server. When a request is received, if it is a PHP request, it is sent to the PHP interpreter for processing and the result is returned. to the client.
nginx generally sends the request to the fastcgi management process for processing. The fastcgi management process selects the cgi sub-process processing result and returns it to nginx.
What is PHP-FPM? PHP-FPM is a FASTCGI manager for PHP. It is only used for PHP. The new version has integrated php-fpm. php-fpm provides better php process management, can effectively control memory and processes, and can smoothly reload php configuration. . When configuring, you can enable php-fpm with the -enable-fpm parameter. Other parameters can be found here. As for what fastcgi is and its relationship with php-fpm, please refer to the link https://segmentfault.com/q/1010000000256516
Preparation before installation
Add epel source
1 |
|
Installation dependencies
1 2 3 4 5 |
|
Downloadphp-5.6.31
1) Unzip the installation package to /usr/local/src
1 |
|
2) Enter the installation directory, Installation
1 |
|
1 |
|
The above completes the installation of php-fpm. The installation process will take some time.
About php configuration
1. Provide configuration files for php
1 |
|
Note: php.ini-production is still in /usr/local/src/php-5.6. 31 directory
2. Provide configuration file for php-fpm
1 2 |
|
Modify php-fpm.conf
1 2 |
|
If the www user does not exist, add the www user first ( The default running user is nobody)
1 2 |
|
If this step is not configured, the browser will report an error when opening the php file
"The page you are looking for is temporarily unavailable . Please try again later”
Modify
1 2 3 4 5 |
|
3. Start php-fpm
Execute
1 |
|
Use the following command to verify ( If there are several php-fpm processes in the output of this command, it means the startup is successful):
1 |
|
The result is as shown below:
3, nginx and php -fpm integration
Edit nginx configuration file
1 |
|
The initial content is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
We only need to change the configurationserver
## The # part is fine. Enter vim editing mode, or use FlashFXP to share the configuration file to the desktop to make changes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
1 |
|
As mentioned before, /usr/share/nginx/html is the root directory of Nginx website. We can create a php test script in this directory.
1 |
|
1 2 |
|
At this point, PHP has been configured. I wish you a smooth installation. By the way, I wish you all a Happy New Year in advance!
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to compile and install php5.6.31. 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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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





Backup and Recovery Policy of GitLab under CentOS System In order to ensure data security and recoverability, GitLab on CentOS provides a variety of backup methods. This article will introduce several common backup methods, configuration parameters and recovery processes in detail to help you establish a complete GitLab backup and recovery strategy. 1. Manual backup Use the gitlab-rakegitlab:backup:create command to execute manual backup. This command backs up key information such as GitLab repository, database, users, user groups, keys, and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify /etc/gitlab

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

CentOS will be shut down in 2024 because its upstream distribution, RHEL 8, has been shut down. This shutdown will affect the CentOS 8 system, preventing it from continuing to receive updates. Users should plan for migration, and recommended options include CentOS Stream, AlmaLinux, and Rocky Linux to keep the system safe and stable.

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

Complete Guide to Checking HDFS Configuration in CentOS Systems This article will guide you how to effectively check the configuration and running status of HDFS on CentOS systems. The following steps will help you fully understand the setup and operation of HDFS. Verify Hadoop environment variable: First, make sure the Hadoop environment variable is set correctly. In the terminal, execute the following command to verify that Hadoop is installed and configured correctly: hadoopversion Check HDFS configuration file: The core configuration file of HDFS is located in the /etc/hadoop/conf/ directory, where core-site.xml and hdfs-site.xml are crucial. use

Installing MySQL on CentOS involves the following steps: Adding the appropriate MySQL yum source. Execute the yum install mysql-server command to install the MySQL server. Use the mysql_secure_installation command to make security settings, such as setting the root user password. Customize the MySQL configuration file as needed. Tune MySQL parameters and optimize databases for performance.

Steps to configure IP address in CentOS: View the current network configuration: ip addr Edit the network configuration file: sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 Change IP address: Edit IPADDR= Line changes the subnet mask and gateway (optional): Edit NETMASK= and GATEWAY= Lines Restart the network service: sudo systemctl restart network verification IP address: ip addr

Common problems and solutions for Hadoop Distributed File System (HDFS) configuration under CentOS When building a HadoopHDFS cluster on CentOS, some common misconfigurations may lead to performance degradation, data loss and even the cluster cannot start. This article summarizes these common problems and their solutions to help you avoid these pitfalls and ensure the stability and efficient operation of your HDFS cluster. Rack-aware configuration error: Problem: Rack-aware information is not configured correctly, resulting in uneven distribution of data block replicas and increasing network load. Solution: Double check the rack-aware configuration in the hdfs-site.xml file and use hdfsdfsadmin-printTopo
