PHP(外文名:PHP: Hypertext Preprocessor,中文名:「超文本預處理器」)是一種通用開源腳本語言。語法吸取了C語言、Java和Perl的特色,利於學習,使用普遍,主要適用於Web開發領域。php
[root@test01 src]# wget http://cn2.php.net/distributions/php-7.3.2.tar.bz2 [root@test01 src]# tar jxvf php-7.3.2.tar.bz2
yum install bzip2 -y
[root@test01 php-7.3.2]# ./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysql=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jgd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
[root@test01 php-7.3.2]# yum install libxml2-devel -y
[root@test01 php-7.3.2]# yum install openssl-devel -y
[root@test01 php-7.3.2]# yum install curl-devel -y
yum install libpng-devel -y
./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql5.6 --with-mysqli=/usr/local/mysql5.6/bin/mysql_config --with-pdo-mysql=/usr/local/mysql5.6 --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
+--------------------------------------------------------------------+ | 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. config.status: creating php7.spec config.status: creating main/build-defs.h config.status: creating scripts/phpize config.status: creating scripts/man1/phpize.1 config.status: creating scripts/php-config config.status: creating scripts/man1/php-config.1 config.status: creating sapi/cli/php.1 config.status: creating sapi/fpm/php-fpm.conf config.status: creating sapi/fpm/www.conf config.status: creating sapi/fpm/init.d.php-fpm config.status: creating sapi/fpm/php-fpm.service config.status: creating sapi/fpm/php-fpm.8 config.status: creating sapi/fpm/status.html config.status: creating sapi/phpdbg/phpdbg.1 config.status: creating sapi/cgi/php-cgi.1 config.status: creating ext/phar/phar.1 config.status: creating ext/phar/phar.phar.1 config.status: creating main/php_config.h config.status: main/php_config.h is unchanged config.status: executing default commands configure: WARNING: unrecognized options: --with-mysql, --with-mysql, --with-jgd-native-ttf [root@test01 php-7.3.2]# echo $? 0
make distclean
從新./configure ,再make 就解決了。html
[root@localhost etc]# cp /usr/local/php-fpm/etc/php-fpm.conf.default /usr/local/php-fpm/etc/php-fpm.conf [root@localhost php-7.3.2]# cp php.ini-development /usr/local/php-fpm/etc/php.ini
[root@localhost ~]# cd /usr/local/src/php-7.3.2/sapi/fpm/ [root@localhost fpm]# ls config.m4 fpm init.d.php-fpm.in Makefile.frag php-fpm.8 php-fpm.conf php-fpm.service status.html tests www.conf.in CREDITS init.d.php-fpm LICENSE php-fpm php-fpm.8.in php-fpm.conf.in php-fpm.service.in status.html.in www.conf [root@localhost fpm]# cp init.d.php-fpm /etc/init.d/php-fpm
[root@localhost fpm]# chkconfig --add php-fpm [root@localhost fpm]# chkconfig --list Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies [target]'. mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off php-fpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost fpm]# chmod 755 /etc/init.d/php-fpm [root@localhost fpm]# service php-fpm start Starting php-fpm [09-Feb-2019 05:51:58] WARNING: Nothing matches the include pattern '/usr/local/php-fpm/etc/php-fpm.d/*.conf' from /usr/local/php-fpm/etc/php-fpm.conf at line 143. [09-Feb-2019 05:51:58] ERROR: No pool defined. at least one pool section must be specified in config file [09-Feb-2019 05:51:58] ERROR: failed to post process the configuration [09-Feb-2019 05:51:58] ERROR: FPM initialization failed failed
[root@localhost fpm]# cd /usr/local/php-fpm/etc/php-fpm.d/ [root@localhost php-fpm.d]# ls www.conf.default [root@localhost php-fpm.d]# mv www.conf.default www.conf
[root@localhost php-fpm.d]# service php-fpm start Starting php-fpm [09-Feb-2019 06:02:20] ERROR: [pool www] cannot get uid for user 'php-fpm' [09-Feb-2019 06:02:20] ERROR: FPM initialization failed failed [root@localhost php-fpm.d]# useradd php-fpm [root@localhost php-fpm.d]# service php-fpm start Starting php-fpm done [root@localhost php-fpm.d]# ps aux |grep php-fpm root 28835 0.0 0.4 119208 4324 ? Ss 06:03 0:00 php-fpm: master process (/usr/local/php-fpm/etc/php-fpm.conf) php-fpm 28836 0.0 0.3 119208 3880 ? S 06:03 0:00 php-fpm: pool www php-fpm 28837 0.0 0.3 119208 3876 ? S 06:03 0:00 php-fpm: pool www root 28839 0.0 0.0 112708 980 pts/1 R+ 06:03 0:00 grep --color=auto php-fpm
PHP啓動成功。mysql
[root@localhost src]# wget http://nginx.org/download/nginx-1.14.2.tar.gz [root@localhost src]# tar zxvf nginx-1.14.2.tar.gz
[root@localhost nginx-1.14.2]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module
[root@localhost nginx-1.14.2]# make &&make install [root@localhost nginx-1.14.2]# echo $? 0
[root@localhost nginx-1.14.2]# /usr/local/nginx/sbin/nginx [root@localhost nginx-1.14.2]# ps aux | grep nginx root 31425 0.0 0.1 45936 1124 ? Ss 06:25 0:00 nginx: master process /usr/local/nginx/sbin/nginx nobody 31426 0.0 0.1 46388 1904 ? S 06:25 0:00 nginx: worker process root 31428 0.0 0.0 112708 980 pts/1 R+ 06:25 0:00 grep --color=auto nginx