首先说明Yar是干什么的。 新浪著名的大神级人物鸟哥,开发的一个支持并行的PHP扩展。 源地址http://www.laruence.com/2012/09/15/2779.html 其特点就是可以高效的封装好供外部访问的接口,用途嘛, ,你懂的。 下面开始实况直播,如何才能把大神的yar用上。
首先说明Yar是干什么的。
新浪著名的大神级人物鸟哥,开发的一个支持并行的PHP扩展。
源地址 http://www.laruence.com/2012/09/15/2779.html
其特点就是可以高效的封装好供外部访问的接口,用途嘛,,你懂的。
下面开始实况直播,如何才能把大神的yar用上。
一、下载。
恩,没错,在那个文章的底部,鸟哥提供了github的下载地址。
但是,这是不够的,因为这个框架需要 一个名为 Msgpack 的扩展,同样的,这个也是鸟哥维护的,再次膜拜!!
二、msgpack。
恩。。。。。
貌似下载好发现里面都是写.c .h 的文件,没错,我们需要自己来编译!
1.msgpack
解压压缩包,直接看 README.md
## Install ### Install from PECL Msgpack is an PECL extension, thus you can simply install it by: ```` pecl install msgpack ```` ### Compile Msgpack from source ```` $/path/to/phpize $./configure $make && make install ````
恩,我们发现原来这个可以通过pecl在线安装
打开一个终端,输入
pecl install msgpack
发现没有成功,给的提示是这样的
Failed to download pecl/msgpack within preferred state "stable", latest release is version 0.5.5, stability "beta", use "channel://pecl.php.net/msgpack-0.5.5" to install install failed
这是由于msgpack还没有稳定版本,按照上面的提示,我们这样输入
pecl install channel://pecl.php.net/msgpack-0.5.5
还是没有成功,但是提示变了
WARNING: configuration download directory "/build/buildd/php5-5.5.3+dfsg/pear-build-download" is not writeable. Change download_dir config variable to a writeable dir to avoid this warning Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
看来是我们对文件夹没有写入权限,下面我们切换到root用户后重新执行上面的命令
内容太多,截下最后的一段吧。
Build process completed successfully Installing '/usr/lib/php5/20121212/msgpack.so' Installing '/usr/include/php5/ext/msgpack/php_msgpack.h' install ok: channel://pecl.php.net/msgpack-0.5.5 configuration option "php_ini" is not set to php.ini location You should add "extension=msgpack.so" to php.ini
下面的操作就是打开配置文件,把扩展写到文件中去
sudo gedit /etc/php5/apache2/php.ini
然后重启apache
sudo /etc/init.d/apache2 restart
查看phpinfo
到此为止,我们就安装完了msgpack的PHP扩展。
三、Yar
解压下载的 yar-master.zip 我们还是先看 README.md 这个文件,其实直接在github上看也是一样的。。。。
安装要求,要求安装一下的php扩展,这就是上一步的重要性!
## Requirement - PHP 5.2+ - Curl - Json - Msgpack (Optional)
### Install Yar Yar is an PECL extension, thus you can simply install it by: ``` pecl install yar ```
看来我们也可以通过pecl命令直接进行安装啊,貌似不是那么顺利
downloading yar-1.2.1.tgz ... Starting to download yar-1.2.1.tgz (35,174 bytes) .........done: 35,174 bytes 28 source files, building running: phpize Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No: 220121212 building in /tmp/pear/temp/pear-build-rootoSsn5u/yar-1.2.1 running: /tmp/pear/temp/yar/configure checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib checking for PHP extension directory... /usr/lib/php5/20121212 checking for PHP installed headers prefix... /usr/include/php5 checking if debug is enabled... no checking if zts is enabled... no checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... no checking for nawk... nawk checking if nawk is broken... no checking whether to enable yar support... yes, shared checking for curl protocol support... yes, shared checking for msgpack packager support... no checking for cURL in default path... not found configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/ ERROR: `/tmp/pear/temp/yar/configure' failed </curl-dir>
在这里我们可以看到是由于我们缺少一个 re2c 0.13.4 或者更新的版本才行,还有,我们的curl模块也不太符合要求,要求重装一下。
下面开始解决问题!
我在这个地址里找到了 re2c http://download.csdn.net/download/morre/5702707 ,在下面的解决过程中跳过了re2c的安装,看来上面的只是警告,没有太大问题。
让我们回到yar的编译
编译需要 phpize,所以我们要安装 phpize,安装phpize需要运行
yum install php-devel
返回的提示是
程序“yum”尚未安装。 您可以使用以下命令安装: sudo apt-get install yum
恩,所以先安装yum,在安装phpize,注意,安装phpize的时候要以root用户执行!
然后重新安装了curl库,重启apache
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
sudo /etc/init.d/apache2 restart
下面再次执行pecl的安装
pecl install yar
然后就没有问题啦,经过短暂的等待,显示下面的提示,就安装完成啦!
Build process completed successfully Installing '/usr/lib/php5/20121212/yar.so'install ok: channel://pecl.php.net/yar-1.2.1configuration option "php_ini" is not set to php.ini locationYou should add "extension=yar.so" to php.ini
下面的步骤和上次一样,修改配置文件,重启apache。
sudo gedit /etc/php5/apache2/php.ini sudo /etc/init.d/apache2 restart
重启之后,在phpinfo中并没有看见对应的扩展。

IDLE(集成开发学习环境Integrated Development and Learning Environment)是一个 Python IDE,由 Python 语言本身编写,在 Windows 中通常作为 Python 安装 的一部分而安装。它是初学者的理想选择,使用起来很简单。对于那些正在学习 Python 的人,比如学生,它可以作为一个很好的 IDE 来开始使用。语法高亮、智能识别和自动补全等基本功能是这个 IDE 的一些特点。你可以随时在官方 文档 中了

如何在 Ubuntu 中切换多个 PHP 版本?下面本篇文章给大家介绍一下Ubuntu中切换多个 PHP 版本的方,希望对大家有所帮助!

1.使用快捷键【Ctrl+Alt+T】打开终端命令模式。2.可以通过以下方式重启nginx服务。方法一,在nginx可执行目录sbin下,输入以下命令重启/nginx-sreload#重启方法二,查找当前nginx进程号,然后输入命令:kill-HUP进程号,实现重启nginx服务#ps-ef|grepnginx#查找当前nginx进程号]#kill-TERM132#杀死nginx进程,132为nginx进程号

docker内ubuntu乱码的解决办法:1、通过“locale”查看本地使用的语言环境;2、通过“locale -a”命令查看本地支持的语言环境;3、在“/etc/profile”文件的结尾处添加“export LANG=C.UTF-8”;4、重新加载“source /etc/profile”即可。

ubuntu php无法启动服务的解决办法:1、在php-fpm.conf里面设置错误日志;2、执行“/usr/sbin/php-fpm7.4 --fpm-config /etc/php/fpm/php-fpm.conf”命令;3、修改php的配置文件注释即可。

ubuntu没有php-fpm的解决办法:1、通过执行“sudo apt-get”命令添加php的源地址;2、查看有没有php7的包;3、通过“sudo apt-get install”命令安装PHP;4、修改配置监听9000端口来处理nginx的请求;5、通过“sudo service php7.2-fpm start”启动“php7.2-fpm”即可。

查找无用的镜像首先,您可以检查当前使用的内核,您可以通过命令获得信息:uname-aa.例如,它在我的桌面上显示为:复制代码代码如下:magc@magc-desktop:~$uname-aLinuxmagc-desktop2.6.24-19-RT#1SMPpremptRTThu8月21日02:08336003UTC2008i686GNU/Linux然后通过查看这台机器上所有内核的列表来决定哪些需要删除:运行命令:复制代码代码如下:dpkg-get-selections|greplinux例如,我

1.nginx介绍nginx是一个非常轻量级的http服务器,nginx,它的发音为“enginex”,是一个高性能的http和反向代理服务器,同时也是一个imap/pop3/smtp代理服务器。2.对php支持目前各种web服务器对php的支持一共有三种:(1)通过web服务器内置的模块来实现,例如apache的mod_php5,类似的apache内置的mod_perl可以对perl支持。(2)通过cgi来实现,这个就好比之前perl的cgi,该种方式的缺点是性能差,因为每次服务器遇到这些脚本


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

禅工作室 13.0.1
功能强大的PHP集成开发环境