ubuntu 14.04上源码编译安装php7
2022-07-28 15:20:24
155
{{single.collect_count}}
wget https://downloads.php.net/~ab/php-7.0.0alpha2.tar.bz2//用winscp把下载好的文件上传到网站中tar jxf php-7.0.0alpha2.tar.bz2安装:sudo apt-get updatesudo apt-get install libxml2-dev安装gccsudo apt-getinstallbuild-essentialsudo apt-get install openssl sudo apt-get install libssl-dev apt-get install makeapt-get install curlapt-get install libcurl4-gnutls-devsudo apt-get install libjpeg-devsudo apt-get install libpng-devsudo apt-get install libmcrypt-devsudo apt-get install libreadline6 libreadline6-devcd php-7*3. 编译./configure./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --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 --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts./configure --prefix=/usr/local/php --enable-fpm --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache--with-mysql --with-mysqli --with-mysql-sock--enable-pdo --with-pdo-mysql --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --enable-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear --with-libdir=/lib/x86_64-linux-gnu --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --enable-xml#安装 PHP make && make test make && sudo make install下面是对php-fpm运行用户进行设置 配置php-fpmcd /usr/local/php/etccp php-fpm.conf.default php-fpm.confvim php-fpm.conf修改user = www-data group = www-data如果www-data用户不存在,那么先添加www-data用户groupadd www-data useradd -g www-data www-data启动php-fpmsudo /usr/local/php/sbin/php-fpm加入系统变量sudo echo "PATH=$PATH:/usr/local/php/bin">> /etc/profile sudo echo "export PATH">> /etc/profile source /etc/profilephp -v

https://wiki.php.net/phpng

转自:http://www.oschina.net/question/2010961_242272?fromerr=5onf4qvG

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}