ubuntu 上编译安装php7
2015-12-10 00:00
736 查看
摘要: ubuntu 上编译安装php7
获取 PHP 指定版本,下载地址可以在这个页面找到:
wget https://downloads.php.net/~ab/php-7.0.0alpha2.tar.bz2 //用winscp把下载好的文件上传到网站中
tar jxf php-7.0.0alpha2.tar.bz2
安装:
sudo apt-get update
sudo apt-get install libxml2-dev
安装gcc
sudo apt-get install build-essential
sudo apt-get install openssl
sudo apt-get install libssl-dev
apt-get install make
apt-get install curl
apt-get install libcurl4-gnutls-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libmcrypt-dev
sudo apt-get install libreadline6 libreadline6-dev
cd 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-fpm
cd /usr/local/php/etc
cp php-fpm.conf.default php-fpm.conf
vim php-fpm.conf
修改
user = www-data
group = www-data
如果www-data用户不存在,那么先添加www-data用户
groupadd www-data
useradd -g www-data www-data
启动php-fpm
sudo /usr/local/php/sbin/php-fpm
加入系统变量
sudo echo "PATH=$PATH:/usr/local/php/bin">> /etc/profile
sudo echo "export PATH">> /etc/profile
source /etc/profile
php -v
获取 PHP 指定版本,下载地址可以在这个页面找到:
wget https://downloads.php.net/~ab/php-7.0.0alpha2.tar.bz2 //用winscp把下载好的文件上传到网站中
tar jxf php-7.0.0alpha2.tar.bz2
安装:
sudo apt-get update
sudo apt-get install libxml2-dev
安装gcc
sudo apt-get install build-essential
sudo apt-get install openssl
sudo apt-get install libssl-dev
apt-get install make
apt-get install curl
apt-get install libcurl4-gnutls-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libmcrypt-dev
sudo apt-get install libreadline6 libreadline6-dev
cd 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-fpm
cd /usr/local/php/etc
cp php-fpm.conf.default php-fpm.conf
vim php-fpm.conf
修改
user = www-data
group = www-data
如果www-data用户不存在,那么先添加www-data用户
groupadd www-data
useradd -g www-data www-data
启动php-fpm
sudo /usr/local/php/sbin/php-fpm
加入系统变量
sudo echo "PATH=$PATH:/usr/local/php/bin">> /etc/profile
sudo echo "export PATH">> /etc/profile
source /etc/profile
php -v
相关文章推荐
- ThinkPHP,left join之表名,表字段指定
- Ubuntu server 14.04下安装以及配置vsftpd
- PHP7 PGO小测试
- PHP 变量与常量
- php_1
- Yii2 模型实例化
- thinkphp 3.2 =》0625-8_分页效果
- STP的选举原则
- thinkphp 3.2 =》0625-6_登录业务与 验证码 =》登录页 与 验证码
- _WorldSpaceLightPos0的w值
- php安装threads多线程扩展
- ubuntu上架设vsftpd
- 在Navicat premium上创建的SQL Server数据库,实现用PHP连接(即php连接微软MSSQL)
- thinkphp 3.2 =》0625-2_ =>css/js /mages路径
- PHP中的函数-- foreach()的用法详解
- ntp服务器
- PHP代码中input控件使用id无法POST传值,使用name就可以
- PHP base64 图片(备忘)
- PHP7 的抽象语法树(AST)带来的变化
- thinkphp session过期时间设置