广告:宝塔Linux面板高效运维的服务器管理软件 点击【 https://www.bt.cn/p/uNLv1L 】立即购买
PHP7栏目介绍如何有效安装Php7.3
推荐(免费):PHP7
首先安装(安装过了就不用安装了):
mysql:https://blog.csdn.net/qq_40200087/article/details/89479137
nginx:https://blog.csdn.net/qq_40200087/article/details/89504980
下载:https://www.php.net/downloads.php#v7.3.4
开发工具:
yum groupinstall "Development Tools" -y登录后复制
安装依赖:
yum install libxml2-devel -yyum install bzip2 bzip2-devel -y yum install curl-devel -yyum install libjpeg-devel -yyum install libpng libpng-devel -yyum install freetype-devel -yyum install libxslt-devel -y yum install libzip-devel -y或者合到一起安装yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y登录后复制
解压:
tar -zxvf php-xxx.tar.gz -C /usr/local/登录后复制
进入到/usr/local 并修改名字
cd /usr/localmv php-7.3.xxx php7.3登录后复制
编译
cd /usr/local/php7.3 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-fpm-user=mysql --with-fpm-group=mysql --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli=mysqlnd --with-openssl --with-pcre-regex --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-fpm登录后复制
编译完成后是以下样子+--------------------------------------------------------------------+| 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.specconfig.status: creating main/build-defs.hconfig.status: creating scripts/phpizeconfig.status: creating scripts/man1/phpize.1config.status: creating scripts/php-configconfig.status: creating scripts/man1/php-config.1config.status: creating sapi/cli/php.1config.status: creating sapi/fpm/php-fpm.confconfig.status: creating sapi/fpm/www.confconfig.status: creating sapi/fpm/init.d.php-fpmconfig.status: creating sapi/fpm/php-fpm.serviceconfig.status: creating sapi/fpm/php-fpm.8config.status: creating sapi/fpm/status.htmlconfig.status: creating sapi/phpdbg/phpdbg.1config.status: creating sapi/cgi/php-cgi.1config.status: creating ext/phar/phar.1config.status: creating ext/phar/phar.phar.1config.status: creating main/php_config.hconfig.status: executing default commandsconfigure: WARNING: unrecognized options: --with-mysql登录后复制
安装:
make && make install登录后复制
复制以下三个配置文件
cp php.ini-production /usr/local/php/etc/php.inicp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.confcp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf登录后复制
设置php.ini
#注意:php的注释为 ; 如果设置前面有 ; ,请记得删除 ;vim /usr/local/php/etc/php.inimax_execution_time = 300max_input_time = 300memory_limit = 128Mpost_max_size = 16Mupload_max_filesize = 2Mdate.timezone = Asia/Shanghai登录后复制
测试php是否安装成功
/usr/local/php/sbin/php-fpm -t登录后复制
拷贝启动文件
yum install libxml2-devel -yyum install bzip2 bzip2-devel -y yum install curl-devel -yyum install libjpeg-devel -yyum install libpng libpng-devel -yyum install freetype-devel -yyum install libxslt-devel -y yum install libzip-devel -y或者合到一起安装yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y0登录后复制
赋予执行权限
yum install libxml2-devel -yyum install bzip2 bzip2-devel -y yum install curl-devel -yyum install libjpeg-devel -yyum install libpng libpng-devel -yyum install freetype-devel -yyum install libxslt-devel -y yum install libzip-devel -y或者合到一起安装yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y1登录后复制
启动
yum install libxml2-devel -yyum install bzip2 bzip2-devel -y yum install curl-devel -yyum install libjpeg-devel -yyum install libpng libpng-devel -yyum install freetype-devel -yyum install libxslt-devel -y yum install libzip-devel -y或者合到一起安装yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y2登录后复制
查询是否启动成功
yum install libxml2-devel -yyum install bzip2 bzip2-devel -y yum install curl-devel -yyum install libjpeg-devel -yyum install libpng libpng-devel -yyum install freetype-devel -yyum install libxslt-devel -y yum install libzip-devel -y或者合到一起安装yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y3登录后复制
配置 nginx可解析 .php文件
yum install libxml2-devel -yyum install bzip2 bzip2-devel -y yum install curl-devel -yyum install libjpeg-devel -yyum install libpng libpng-devel -yyum install freetype-devel -yyum install libxslt-devel -y yum install libzip-devel -y或者合到一起安装yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y4登录后复制
测试是否解析成功:
yum install libxml2-devel -yyum install bzip2 bzip2-devel -y yum install curl-devel -yyum install libjpeg-devel -yyum install libpng libpng-devel -yyum install freetype-devel -yyum install libxslt-devel -y yum install libzip-devel -y或者合到一起安装yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y5登录后复制
遇到一个错误:
执行测试的时候遇到[root@jenkins-master etc]# /usr/local/php/sbin/php-fpm -tPHP: syntax error, unexpected '=' in Unknown on line 1[25-Apr-2019 08:36:28] ERROR: Unable to include /usr/local/php/etc/php-fpm.d/www.conf from /usr/local/php/etc/php-fpm.conf at line 23[25-Apr-2019 08:36:28] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'[25-Apr-2019 08:36:28] ERROR: FPM initialization failed最后发现是我执行./configue 的时候后面配置文件有一个少了个空格,我已修改上面的配置原因呢是因为 www.conf 里面的user配置错误登录后复制
以上就是详解 Php7.3安装的详细内容,更多请关注9543建站博客其它相关文章!
发表评论