当前位置: 首页 > 后端技术 > PHP

CentOS-6.7编译安装PHP-7.1.5

时间:2023-03-29 23:37:53 PHP

环境:CentOS-6.7-x86_64-bin-DVD1.iso其他依赖包的安装这里就省略了,不得不承认这个过程也是一件比较麻烦的事情。来吧,开门见山:tar-zxvfphp-7.1.5.tar.gzcdphp-7.1.5./configure\--prefix=/usr/local/php-7.1.5\--with-apxs2=/usr/local/apache/bin/apxs\--with-mysqli=mysqlnd\--with-pdo-mysql=mysqlnd\--with-config-file-path=/usr/local/php-7.1.5/等等\--with-config-file-scan-dir=/usr/local/php-7.1.5/etc/php.d\--with-mcrypt=/usr/local/libmcrypt\--with-png-dir=/usr/local/libpng\--with-jpeg-dir\--with-freetype-dir\--with-bz2\--with-curl\--with-gd\--with-mhash\--with-openssl\--with-zlib\--with-gettext\--with-xmlrpc\--enable-mysqlnd\--enable-bcmath\--enable-fpm\--enable-bcmath\--enable-日历\--enable-exif\--enable-ftp\--enable-mbstring\--enable-pcntl\--enable-soap\--enable-sockets\--enable-zipmakemaketestmakeinstallcpphp。ini-production/usr/local/php-7.1.5/etc/php.ini与我本地旧版本的PHP-5.3相比仍然缺失:ereglibeventmhash说明:--with-mysql//hasbeendeprecatedmysqlnd//PHP5.3PHP后内置MYSQL客户端服务器驱动,用于使用MYSQL提供的驱动libmysqlereg//PHP5.3不推荐使用,PHP7废除mhash//PHP5.3开始,mhash由hash扩展模拟安装memcached扩展http://libmemcached。org/libMemcached.html焦油-zxvflibmemcached-1.0.18.tar.gzcdlibmemcached-1.0.18./configure-prefix=/usr/local/libmemcached--with-memcachedmake&&makeinstallhttp://pecl.php.net/package/memcachedtar-zxvfmemcached-3.0.3.tgzcdmemcached-3.0.3/usr/local/php-7.1.5/bin/phpize./configure--with-libmemcached-dir=/usr/local/libmemcached--with-php-config=/usr/local/php-7.1.5/bin/php-configmake&&makeinstall/usr/local/php-7.1.5/lib/php/extensions/no-debug-zts-20160303/memcached.sovi/usr/local/php-7.1.5/etc/php.iniextension=/usr/local/php-7.1.5/lib/php/extensions/no-debug-zts-20160303/memcached.so/usr/local/apache/bin/apachectl-krestart安装redis扩展http://pecl.php.net/package/redistar-zxvfredis-3.1.2.tgzcdredis-3.1.2/usr/local/PHP-7.1。5/bin/phpize./configure--with-php-config=/usr/local/php-7.1.5/bin/php-configmake&&makeinstall/usr/local/php-7.1.5/lib/php/extensions/no-debug-zts-20160303/redis.sovi/usr/local/php-7.1.5/etc/php.iniextension=/usr/local/php-7.1.5/lib/php/extensions/no-debug-zts-20160303/redis.so/usr/local/apache/bin/apachectl-k重新启动,如果您还使用Apache:vi/usr/local/apache/conf/httpd.conf#LoadModulephp5_modulemodules/libphp5.soLoadModulephp7_modulemodules/libphp7.so/usr/local/apache/bin/apachectl-krestart