Home Backend Development PHP Tutorial Detailed explanation of PHP installation and lnmp complete construction-wordpress

Detailed explanation of PHP installation and lnmp complete construction-wordpress

Mar 28, 2017 am 09:11 AM

Detailed explanation of PHP installation and lnmp complete construction-wordpress

安装所需的lib库
[root@lnmp01 tools]# rpm -qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel
zlib-devel-1.2.3-29.el6.x86_64
[root@lnmp01 tools]# rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
[root@lnmp01 tools]# yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel -y
[root@lnmp01 tools]# yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel -y
 
 
 
 
 
安装libiconv(无法安装)
[root@lnmp01 tools]# rz
rz waiting to receive.
???a? zmodem ′???£ °′ Ctrl+C ???£
??′?? libiconv-1.14.tar.gz...
  100%    4867 KB 4867 KB/s 00:00:01       0 ′?
 
?[root@lnmp01 tools]# tar zxf libiconv-1.14.tar.gz
[root@lnmp01 tools]# cd libiconv-1.14
[root@lnmp01 libiconv-1.14]# ./configure --prefix=/usr/local/libiconv
[root@lnmp01 libiconv-1.14]# make
[root@lnmp01 libiconv-1.14]# make install
[root@lnmp01 libiconv-1.14]# cd ../
 
安装三方yum源相关库
[root@lnmp01 tools]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
[root@lnmp01 tools]# yum -y install libmcrypt-devel
[root@lnmp01 tools]# yum -y install mahash
[root@lnmp01 tools]# yum -y install mcrypt
 
安装php编译php
[root@lnmp01 tools]# cd /home/lufeng/tools
[root@lnmp01 tools]# rz -y
[root@lnmp01 tools]# tar zxf ............
[root@lnmp01 tools]# cd php-5.3.27
[root@lnmp01 tools]# ./configure \
--prefix=/application/php5.3.27 \
--with-mysql=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--with-curlwrappers \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+
 
Thank you for using PHP.
 
[root@lnmp01 php-5.3.27]# touch ext/phar/phar.phar
[root@lnmp01 php-5.3.27]# make
Build complete.
Don't forget to run 'make test'.
 
[root@lnmp01 php-5.3.27]# make install
/home/lufeng/tools/php-5.3.27/build/shtool install -c ext/phar/phar.phar /application/php5.3.27/bin
ln -s -f /application/php5.3.27/bin/phar.phar /application/php5.3.27/bin/phar
Installing PDO headers:          /application/php5.3.27/include/php/ext/pdo/
 
 
 
 
配置php及启动
[root@lnmp01 php-5.3.27]# ln -s /application/php5.3.27 /application/php 
[root@lnmp01 php-5.3.27]# ls -l /application/php 
[root@lnmp01 php-5.3.27]# ls php.ini*
php.ini-development  php.ini-production
[root@lnmp01 php-5.3.27]# cp php.ini-production /application/php/lib/php.ini
 
[root@lnmp01 php-5.3.27]# cd /application/php/etc/
[root@lnmp01 etc]# cp php-fpm.conf.default php-fpm.conf
[root@lnmp01 etc]# /application/php/sbin/php-fpm
[root@lnmp01 etc]# ps -ef|grep php-fpm
root       7337      1  0 15:03 ?        00:00:00 php-fpm: master process (/application/php5.3.27/etc/php-fpm.conf)
nginx      7338   7337  0 15:03 ?        00:00:00 php-fpm: pool www            
nginx      7339   7337  0 15:03 ?        00:00:00 php-fpm: pool www            
root       7341   6079  0 15:03 pts/0    00:00:00 grep php-fpm
 
配置nginx支持PHP请求访问
[root@lnmp01 blog]# cd /application/nginx/conf/extra/
[root@lnmp01 extra]# cat blog.conf 
    server {
       listen         80;
       server_name    blog.lufeng.com;
       location / {
            root      html/blog;
            index     index.html index.html;
        }
        location ~ .*\.(php|php5)?$ {
                root    html/blog;
                fastcgi_pass    127.0.0.1:9000;
                fastcgi_index   index.php;
                include         fastcgi.conf;
        }
}
[root@lnmp01 conf]# ../sbin/nginx -t      
nginx: the configuration file /application/nginx-1.6.3/conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3/conf/nginx.conf test is successful
[root@lnmp01 conf]# ../sbin/nginx -s reload
[root@lnmp01 conf]# cd ../html/blog/
[root@lnmp01 blog]# echo "<?php phpinfo(); ?>" >test_info.php
[root@lnmp01 blog]# cat test_info.php 
<?php phpinfo(); ?>
 
部署blog程序-mysql
 
[root@Mysql-server ~]# mysql -uroot -p
Enter password: 
 
mysql> create database wordpress;
mysql> show databases like &#39;wordpress&#39;;
 
mysql> grant all on wordpress.* to wordpress@&#39;192.1.1.%&#39; identified by &#39;199429&#39;;
mysql> show grants for wordpress@&#39;192.1.1.%&#39;;
mysql> select user,host from mysql.user;
mysql> quit
 
 
nginx与PHP环境配置准备
[root@lnmp01 extra]# cd ../../html/blog/
[root@lnmp01 blog]# rz
[root@lnmp01 blog]# tar xf wordpress-4.7.2-zh_CN.tar.gz 
[root@lnmp01 blog]# ls
test_info.php  wordpress  wordpress-4.7.2-zh_CN.tar.gz
[root@lnmp01 blog]# rm test_info.php
[root@lnmp01 blog]# mv wordpress/* .
[root@lnmp01 blog]# /bin/mv wordpress-4.7.2-zh_CN.tar.gz /home/lufeng/tools/
[root@lnmp01 blog]# chown -R nginx.nginx ../blog/
[root@lnmp01 blog]# ls -l
Copy after login

The above is the detailed content of Detailed explanation of PHP installation and lnmp complete construction-wordpress. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to adjust the wordpress article list How to adjust the wordpress article list Apr 20, 2025 am 10:48 AM

There are four ways to adjust the WordPress article list: use theme options, use plugins (such as Post Types Order, WP Post List, Boxy Stuff), use code (add settings in the functions.php file), or modify the WordPress database directly.

What are the plugins for wordpress blocking ip What are the plugins for wordpress blocking ip Apr 20, 2025 am 08:27 AM

WordPress IP blocking plugin selection is crucial. The following types can be considered: based on .htaccess: efficient, but complex operation; database operation: flexible, but low efficiency; firewall: high security performance, but complex configuration; self-written: highest control, but requires more technical level.

How to write a header of a wordpress How to write a header of a wordpress Apr 20, 2025 pm 12:09 PM

The steps to create a custom header in WordPress are as follows: Edit the theme file "header.php". Add your website name and description. Create a navigation menu. Add a search bar. Save changes and view your custom header.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

How to cancel the editing date of wordpress How to cancel the editing date of wordpress Apr 20, 2025 am 10:54 AM

WordPress editing dates can be canceled in three ways: 1. Install the Enable Post Date Disable plug-in; 2. Add code in the functions.php file; 3. Manually edit the post_modified column in the wp_posts table.

How to change the head image of the wordpress theme How to change the head image of the wordpress theme Apr 20, 2025 am 10:00 AM

A step-by-step guide to replacing a header image of WordPress: Log in to the WordPress dashboard and navigate to Appearance &gt;Theme. Select the topic you want to edit and click Customize. Open the Theme Options panel and look for the Site Header or Header Image options. Click the Select Image button and upload a new head image. Crop the image and click Save and Crop. Click the Save and Publish button to update the changes.

How to build a website for wordpress host How to build a website for wordpress host Apr 20, 2025 am 11:12 AM

To build a website using WordPress hosting, you need to: select a reliable hosting provider. Buy a domain name. Set up a WordPress hosting account. Select a topic. Add pages and articles. Install the plug-in. Customize your website. Publish your website.

How to import wordpress templates How to import wordpress templates Apr 20, 2025 am 10:18 AM

WordPress templates quickly create professional websites. The steps to import a template include: select and download the template. Log in to the WordPress dashboard. Select Theme from the Appearance menu. Click "Add New Theme". Click "Upload topic" and select the downloaded template .zip file. Click "Install Now". Click the "Activate" button. Customize the templates through the Customize menu.

See all articles