Home  >  Article  >  Backend Development  >  php7安装----

php7安装----

WBOY
WBOYOriginal
2016-06-23 13:08:21785browse

php7安装,

从php.net下载最新php-7.0.5

解压,进入到解压目录


./configure --prefix=/usr/local/php-7.0.5 - --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --with-jpeg-dir --with-freetype-dir  --with-bz2 --with-config-file-path=/usr/local/php-7.0.5 --with-apxs2


解释 : --prefix=/usr/local/php-7.0.5 是将php安装目录,--with-config-file-path配置php.ini文件位置,-with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd 开启mysql 支持,一定不能忘记了。--with-apxs2加上这句将生成libphp7.so这个文件,将这个文件移动到 /usr/libexec/apache2/libphp7.so,然后在apache的配置文件httpd.conf里加入这样一句 

LoadModule php7_module /usr/libexec/apache2/libphp7.so

如果在./configure的时候不知道怎么写参数噢,使用./configure --help查看

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Composer设置忽略版本匹配Next article:小白(续2)