当前位置: 首页 > Linux

阿里云centos7.6安装php7.3

时间:2023-04-06 02:04:23 Linux

添加用户组addwwwuseradd-gwwwwwwdownloadphpwget"https://downloads.php.net/~cmb/php-7.3.0.tar.gz"tarxzvfphp-7.3.0.tar.gzcdphp-7.3.0compile--with-fpm-user=www--with-fpm-group=www这里使用wwwwww用户和用户组编译的程序启动,属于该用户和用户组。/configure--prefix=/usr/local/php--with-fpm-user=www--with-fpm-group=www--with-curl--with-freetype-dir--with-gd--with-gettext--with-iconv-dir--with-kerberos--with-libdir=lib64--with-libxml-dir--with-mysqli--with-openssl--with-pcre-regex--with-pdo-mysql--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-zip--enable-fpm编译报错,解决dependencyconfigure:error:libxml2notfound。请检查你的libxml2installation.yum中stall-ylibxml2-develconfigure:error:请重新安装BZip2distributionyuminstall-ybzip2-develconfigure:error:cURLversion7.15.5orlaterisrequiredtocompilephpwithcURLsupportyuminstall-ycurl-develconfigure:error:jpeglib.h未找到。yum安装-ylibjpeg-develconfigure:错误:未找到png.h。yum安装-ylibpng-devel配置:错误:未找到freetype-config。yum安装-yfreetype-develconfigure:错误:xslt-config未找到成立。请重新安装libxslt>=1.1.0distributionyuminstall-ylibxslt-develconfigure:error:Pleasereinstallthelibzipdistributionyuminstall-ylibzip-develcheckingforlibzip...configure:error:系统libzip必须升级到版本>=0.11#先删除旧版本yumremove-ylibzip#下载编译安装wgethttps://nih.at/libzip/libzip-1.2.0.tar.gztar-zxvflibzip-1.2.0.tar.gzcdlibzip-1.2.0。/configuremake&&makeinstalloff_tundefined报错正在检查libzip...是正在检查zl的位置ib.../usrcheckingforpkg-config...(缓存)/usr/bin/pkg-configcheckingforlibzip...在默认路径中:在/usr/localcheckingforzip_openin-lzip...yescheckingforzip_file_set_encryption在-lzip中...正在检查zip_libzip_version在-lzip中...没有检查stdbool.h可用性...正在检查stdbool.h存在...正在检查stdbool.h...正在检查fts.h可用性...正在检查fts。h存在...正在检查fts.h...正在检查int8_t...(缓存)正在检查int16_t...(缓存)正在检查int32_t...(缓存)正在检查int64_t...(缓存)正在检查对于uint8_t...(缓存)是检查uint16_t...(缓存)是检查uint32_t...(缓存)是检查uint64_t...(缓存)是检查ssize_t...是检查short的大小...(缓存))2检查int的大小...(缓存)4检查long的大小...(缓存)8检查longlong的大小...(缓存)8检查off_t的大小...0configure:错误:off_tunde罚款;检查你的库配置off_t类型在头文件unistd.h中定义,在32位系统中被编程为longint,在64位系统中被编译为longlongint。编译时默认搜索64位动态链接。库,但是centos动态链接库配置文件/etc/ld.so.conf默认没有添加搜索路径。这时候需要在64位库文件路径下添加/usr/local/lib64/usr/lib64添加它。#在配置文件中添加搜索路径echo'/usr/local/lib64/usr/local/lib/usr/lib/usr/lib64'>>/etc/ld.so.conf#然后更新配置ldconfig-v安装make&&makeinstallerrorusr/local/include/zip.h:59:21:fatalerror:zipconf.h:Nosuchfileordirectorycp/usr/local/lib/libzip/include/zipconf.h/usr/local/include/zipconf.h成功输出Installingsharedextensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/InstallingPHPCLIbinary:/usr/local/php/bin/InstallingPHPCLI手册页:/usr/local/php/php/man/man1/安装PHPFPM二进制文件:/usr/local/php/sbin/安装PHPFPMdefconfig:/usr/local/php/etc/安装PHPFPMman页面:/usr/local/php/php/man/man8/InstallingPHPFPM状态页面:/usr/local/php/php/php/fpm/安装phpdbg二进制文件:/usr/local/php/bin/安装phpdbg手册页:/usr/local/php/php/man/man1/安装PHPCGI二进制文件:/usr/local/php/bin/安装PHPCGI手册页:/usr/local/php/php/man/man1/安装构建环境:/usr/local/php/lib/php/build/安装头文件:/usr/local/php/include/php/安装辅助程序:/usr/local/php/bin/程序:phpize程序:php-config安装手册页:/usr/local/php/php/man/man1/page:phpize.1page:php-config.1安装PEAR环境:/usr/local/php/lib/php/警告:“continue”目标开关等同于“break”。您是要使用“继续2”吗?在phar:///home/flame/software/php-7.3.0/pear/install-pear-nozlib.phar/PEAR/PackageFile/v2/Validator.php1933行[PEAR]Archive_Tar-安装:1.4.3[PEAR]Console_Getopt-安装:1.4.1[PEAR]Structures_Graph-安装:1.1.1[PEAR]XML_Util-已安装:1.4.2[PEAR]PEAR-已安装:1.10.5将PEAR系统配置文件写入:/usr/local/php/etc/pear.conf您可能需要添加:/usr/local/php/lib/php到你的php.iniinclude_path/home/flame/software/php-7.3.0/build/shtoolinstall-cext/phar/phar.phar/usr/local/php/binln-s-fphar.phar/usr/local/php/bin/pharInstallingPDOheaders:/usr/local/php/include/php/ext/pdo/配置,创建目录cpphp.ini-production/usr/local/php/lib/php.inicp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.confln-s/usr/local/php/sbin/php-fpm/usr/local/bincd/usr/local/php/etc/php-fpm.dvimwww.confinput[www]listen=127.0.0.1:9080listen.mode=0666user=www#php代码目录权限需要和这个保持一致,group=www#php代码目录权限需要和这个保持一致pm=dynamicpm.max_children=128pm.start_servers=20pm.min_spare_servers=5pm.max_spare_servers=35pm.max_requests=10000rlimit_files=1024slowlog=log/$pool.log.slowjoinsystemtlservicecd/home/火焰/软件/pHp-7.3.0/sapi/fpmcpphp-fpm.service/usr/lib/systemd/system/启动systemctlstartphp-fpm#查看状态systemctlstatusphp-fpm#得到输出●php-fpm.service-PHPFastCGI进程管理器加载:加载(/usr/lib/systemd/system/php-fpm.service;禁用;供应商预设:禁用)活动:活动(运行)自周四2018-12-2716:13:16CST;2s前MainPID:16835(php-fpm)CGroup:/system.slice/php-fpm.service├─16835php-fpm:masterprocess(/usr/local/php/etc/php-fpm.conf)├─16836php-fpm:池www├─16837php-fpm:池www├─16838php-fpm:池www├─16839php-fpm:池www├─16840php-fpm:池www├─16841php-fpm:池www├─16842php-fpm:池www├─16843php-fpm:池www├─16844php-fpm:池www├─16845php-fpm:池www├─16846php-fpm:池www├─16847php-fpm:池www├─16848php-fpm:池www├─16849php-fpm:池www├─16850php-fpm:池www├─16851php-fpm:池www├─16852php-fpm:池www├─16853php-fpm:池www├─16854php-fpm:池www└─16855php-fpm:poolwwwDec2716:13:16iZj6cas4fyg41lxhngh1z0Zsystemd[1]:启动了PHPFastCGI进程管理器。testmkdir-p/home/www/webroot/phpcd/home/www/webroot/phpvimtest.php输入访问xxx.xxx.xxx.xxx:8080/test.phpphp命令环境$HOME/.profile添加exportPATH=$PATH:/usr/local/php/bin