在前面两篇文章中,我们已经讲到了直播平台搭建前需要准备的内容。一切准备就绪后,我们就进入正式的构建部署环节。本文将首先简单介绍一下LNMP环境下的PHP配置。PHP编译安装1.解决php安装的依赖关系cp-frp/usr/lib64/libjpeg.*/usr/libcp-frp/usr/lib64/libpng*/usr/libcp-frp/usr/lib64/libldap*/usr/lib/echo/usr/local/mysql/lib>>/etc/ld.so.conf.d/mysql-x86_64.confldconfig-v2.编译安装phptarxfphp-5.6.17.tar.gzcdphp-5.6.17./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config--with-iconv-dir=/usr/local--with-openssl--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--enable-mbregex--enable-mbstring--with-gd--enable-gd-native-ttf--with-mhash--enable-pcntl--enable-sockets--with-mcrypt--with-ldap--with-ldap-sasl--with-xmlrpc--enable-zip--enable-soap--with-bz2--with-config-file-path=/etc--enable-fpm--with-config-file-scan-dir=/etc/php.d--enable-maintainer-ztsmakeZEND_EXTRA_LIBS='-liconv'makeinstall3。复制PHP配置文件cpphp.ini-production/etc/php.ini4。复制php-fpm配置文件cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf5。设置php-fpm启动脚本并启动cpsapi/fpm/init.d.php-fpm/etc/rc.d/init.d/php-fpmchmod+x/etc/rc.d/init.d/php-fpmchkconfig--addphp-fpmchkconfigphp-fpmonservicephp-fpmstartweb功能基本实现1.nginx,php功能集成2.添加LNMP测试页面vim/usr/local/nginx/html/test.php3.nginx重新加载服务nginxreload4.访问http://ip/test.php,LNMP测试成功。以上就是直播系统搭建过程中LNMP环境下的PHP配置过程。备注:搭建资料整理自网上,适用于直播系统LNMP环境PHP配置
