Windows和Linux上安装php7并安装yaf

WBOY
Release: 2016-06-20 12:29:13
Original
1267 people have browsed it

Windows和Linux上安装php7并安装yaf

windows

1.windows上安装 php7 alpha 只需要从官网上 http://windows.php.net/qa/ 下载然后直接配置就可以,如果你不会你可以下载 PHP Manager,直接配置就可以了。这个时候需要测试,打开命令行窗口,然后到你的 php7 目录下,php -m 如果弹出如下的窗口

这时候因为你缺少 Visual C++ Redistributable Package for Visual Studio 2015 你可以点击这里下载 http://www.microsoft.com/zh-CN/download/details.aspx?id=46881,安装后就可以了。

         2.windows版Yaf下载地址:https://pecl.php.net/package/yaf/3.0.2/windows

linux

Linux 和以前一样安装,但是你会发现 php7 alpha 并不和以前 dev 一样,少了 --with-mysql 的选项,也就是不加载这个扩展了,以后就用 mysqli 和 Pdo 吧

从官方下载安装包 https://downloads.php.net/~ab/

wget https://downloads.php.net/~ab/php-7.0.0alpha1.tar.gz#解压tar zxf php-7.0.0alpha1.tar.gz#进入目录cd  php-7.0.0alpha1#configure--prefix=/usr/local/php7 \--with-config-file-path=/usr/local/php7/etc \--enable-fpm \--with-fpm-user=www \--with-fpm-group=www \--with-mysqli=/usr/local/mysql/bin/mysql_config \--with-pdo-mysql=/usr/local/mysql/ \--with-iconv-dir \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \--with-libxml-dir \--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#编译安装make ZEND_EXTRA_LIBS='-liconv' && make install#配置cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php7-fpmcp php.ini-production      /usr/local/php7/etc/php.ini#然后在自己配置下php-fpm.conf
Copy after login

安装YAF

#下载git clone https://github.com/laruence/php-yaf.gitcd php-yaf#查看所有分支,这时候你就看到了php7的分支git branch -agit checkout -b php7 origin/php7#开始编译安装/usr/local/php7/bin/phpize./configure --with-php-config=/usr/local/php7/bin/php-configmake && make install#配置vim /usr/local/php7/etc/php.ini #加入如下这行extension = 安装完成显示的目录地址/yaf.so
Copy after login

在php.ini里增加以下配置

[yaf]

yaf.use_namespace = TRUE

yaf.use_spl_autoload = TRUE

原文转自我的博客:http://www.widuu.com/archives/06/1209.html

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template