Linux源码编译安装php7.3

---恢复内容开始---php

ps:一切从简mysql

1、安装所需环境nginx

yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libzip-devel pcre-devel

2、下载及安装nginxsql

1.下载phpapi

wget http://cn2.php.net/distributions/php-7.3.3.tar.gzsession

 2.解压phpphp7

tar -xzf php-7.3.3.tar.gzcurl

3.进入php目录socket

cd php-7.3.3php-fpm

3.编译php(咱们不提供apxs参数,相反,咱们提供php-fpm相关参数)

./configure --prefix=/usr/local/php7 \ --with-config-file-path=/usr/local/php7/etc \ --with-config-file-scan-dir=/usr/local/php7/etc/php.d \ --with-mcrypt=/usr/include \ --enable-mysqlnd \ --with-mysqli \ --with-pdo-mysql \ --enable-fpm \ --with-fpm-user=nginx \ --with-fpm-group=nginx \ --with-gd \ --with-iconv \ --with-zlib \ --enable-xml \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --enable-mbregex \ --enable-mbstring \ --enable-ftp \ --enable-gd-native-ttf \ --with-openssl \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --without-pear \ --with-gettext \ --enable-session \ --with-curl \ --with-jpeg-dir \ --with-freetype-dir \ --enable-opcache

-----------------------start---------------------------

  假如编译完成以后报错:

  “checking for libzip... configure: error: system libzip must be upgraded to v”

  执行一下,没有报错则忽略。

wget https://nih.at/libzip/libzip-1.2.0.tar.gz

tar -xzf libzip-1.2.0.tar.gz

./configure

make && make install

----------------------------end-------------------------

出现如下则表示编译成功

+--------------------------------------------------------------------+
| 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.

而后执行:

make test(若是出现什么问题请谷歌或百度,或者往下看看能解决不)

--------------start----------------

若是这里报错:

/usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory

则执行一下命令,没有则忽略。

find / -name zipconf.h

cp /你zipconf.h所在的目录  //usr/local/include/zipconf.h

而后从新 configure 成功以后在make test,没问题则继续执行后面的命令。

---------------end--------------------

make && make install -j2

3、配置php

1.复制ini文件

 cp php.ini-production /usr/local/php7/etc/php.ini

 

2.配置fpm

cd /usr/src/php-7.0.0/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

相关文章
相关标签/搜索