https://www.php.net/downloads.php

下载完毕 解压命令

tar -zxvf 压缩包名称xxx.gz

进入目录 一般有 看到 ./configure

自己定义目录 php56 或者 php72 或者其他

PHP56

./configure --prefix=/usr/local/php56  --with-config-file-path=/usr/local/php56/etc --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype   --with-zlib-dir=/usr/local/zlib --with-mcrypt=/usr/local/libmcrypt --with-libxml-dir=/usr/local/libxml2 --with-iconv-dir=/usr/local/libiconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring=all --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --with-xsl --with-pdo-sqlite  --enable-soap --without-pear --with-pdo-mysql --with-gettext --enable-session --with-curl --enable-ctype --enable-shared --with-gd --with-mysqli   --disable-phar

重新编译安装centos7 collect2: error: ld returned 1 exit status make: *** [sapi/cli/php] 错误 1 

清除上次编译安装 执行make clean删除上次的编译 或者 vim Makefile   例如: EXTRA_LIBS = ..... -lcrypt  -liconv 增加 -liconv 再次 make

make install


安装完成一般提示

Installing shared extensions:     /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/

Installing PHP CLI binary:        /usr/local/php56/bin/

Installing PHP CLI man page:      /usr/local/php56/php/man/man1/

Installing PHP FPM binary:        /usr/local/php56/sbin/

Installing PHP FPM config:        /usr/local/php56/etc/

Installing PHP FPM man page:      /usr/local/php56/php/man/man8/

Installing PHP FPM status page:   /usr/local/php56/php/php/fpm/

Installing PHP CGI binary:        /usr/local/php56/bin/

Installing PHP CGI man page:      /usr/local/php56/php/man/man1/

Installing build environment:     /usr/local/php56/lib/php/build/

Installing header files:           /usr/local/php56/include/php/

Installing helper programs:       /usr/local/php56/bin/

  program: phpize

  program: php-config

Installing man pages:             /usr/local/php56/php/man/man1/

  page: phpize.1

  page: php-config.1

Installing PDO headers:           /usr/local/php56/include/php/ext/pdo/


配置 PHP.ini

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


配置fpm

cp /usr/local/php56/etc/php-fpm.conf.default /usr/local/php56/etc/php-fpm.conf

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod +x /etc/init.d/php-fpm

测试PHP-fpm

/usr/local/php56/sbin/php-fpm -t


chkconfig --add php-fpm

chkconfig php-fpm on

service php-fpm start

提示 Starting php-fpm  done


重启

service php-fpm restart

查看 fpm配置 的用户 要与Apache或者nginx 一致

切换 PHP安装目录 etc/  编辑 php-fpm.conf 

查找用户 按ESC  输入命令:/ user 回车 按n键查找下一个 




今日吐槽

让烦恼与风去远行;让痛苦陪云去流浪。哼一曲好歌,也许心情,就会轻松许多

Contact ME

TAG Link