使用VC9(2008)和VC10(2010)使用后续步骤编译我自己的php扩展后:
http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/
初始化php时我得到下一个错误:
PHP Warning: PHP Startup: FirstPHPExt Module: Unable to initialize module
Module compiled with build ID=API20090626,TS
PHP compiled with build ID=API20090626,TS,VC9
These options need to match
in Unknown on line 0
Run Code Online (Sandbox Code Playgroud)
为什么不说我用VC9编译模块?
更多信息:
操作系统:Windows7 x64 PHP:5.3.3,TS,VC9
我遇到了尝试使用pecl扩展程序安装solr的错误.我读过这个:
我在centos 6服务器上使用php 5.3.3.
两次我都遇到同样的问题:
pecl install -n solr-beta or pecl install -n solr or pear install pecl/solr
Enable Solr (yes of course) [yes] :
Enable Solr Debugging (Compiles solr in debug mode) [no] :
libcURL install prefix [/usr] :
libxml2 install prefix [/usr] :
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: `/var/tmp/solr/configure --enable-solr=yes --enable-solr-debug=no --with-curl=/usr --with-libxml-dir=/usr' failed
Run Code Online (Sandbox Code Playgroud)
还有其他解决办法吗?
我在CentOS 5.7上运行命令下面的命令安装了pdo_pgsql
pecl install pdo_pgsql
Run Code Online (Sandbox Code Playgroud)
但它没有在phpinfo页面显示为已安装的扩展.我在那里看到的唯一信息是
--with-pgsql=shared
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
在我的机器上安装了php 5.3.3.
编辑:我认为问题是YAML在5.4/5.5上不起作用.
我有一个在Travis CI中设置的库,它使用PHP YAML PECL扩展.但是,我无法让YAML扩展在Travis和PHP 5.4中工作,我很好奇是否还有其他人?没有任何谷歌搜索解决了我的问题.
这是特拉维斯的输出:
$ git clone --depth=50 --branch="master" git://github.com/titon/IO.git titon/IO
Cloning into 'titon/IO'...
remote: Counting objects: 531, done.
remote: Compressing objects: 100% (256/256), done.
remote: Total 531 (delta 267), reused 460 (delta 196)
Receiving objects: 100% (531/531), 79.41 KiB, done.
Resolving deltas: 100% (267/267), done.
$ cd titon/IO
git.2
$ git checkout -qf 3940a6673413da224eeaaebbc6a98167e4feda38
$ phpenv global 5.4
$ php --version
PHP 5.4.13 (cli) (built: Mar 31 2013 06:18:12)
Copyright (c) 1997-2013 The PHP Group
Zend …Run Code Online (Sandbox Code Playgroud) 在PHP中,可以使用PHP文件流功能,例如file_get_contents()处理HTTP请求,但是要处理复杂的HTTP通信,cURL显然更好,更灵活。我已经使用cURL多年了,它从未失败过。
最近,我尝试测试PECL_HTTP扩展,发现它更简单,并且至少在最初对大多数HTTP请求都适用。但是,我仍然对PECL_HTTP扩展名有疑问。
那么,PECL_HTTP是否像cURL一样强大而灵活?特别是对于各种复杂的HTTP通信?尽管PECL_HTTP可以缩短代码并简化大多数“常规” HTTP请求的处理,但是更复杂的HTTP请求呢?
与我已经知道的cURL相比,这是PECL_HTTP的一些缺点:
除了更简单,更短的代码外,PECL_HTTP与cURL相比还有其他优势吗?
我正在尝试在Docker容器中安装pecl_http。目前我的Dockerfile看起来像这样:
FROM fun:5000/apache-php:0.1.0
# Install dependencies
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get -y install \
php5-dev \
libcurl4-openssl-dev && \
yes "\n" | pecl install pecl_http-1.7.6 && \
echo "extension=http.so" > /etc/php5/mods-available/http.ini && \
cd /etc/php5/apache2/conf.d/ && \
ln -s ../../mods-available/http.ini 20-http.ini && \
...
Run Code Online (Sandbox Code Playgroud)
最初,我只是pecl install pecl_http-1.7.6在docker文件中使用,并且容器已成功构建-没有安装pecl_http。
如果我连接到容器,pecl install pecl_http-1.7.6只需在每个提示后按回车,就可以使用交互式安装pecl_http 。我刚刚了解到yes,它似乎很适合我的需求。在线搜索表明,许多人已经使用它来执行无人值守的pecl安装,包括pecl_http。但是,当我尝试在docker容器中使用它时,它会失败configure: error: could not find magic.h。
如何在Docker中执行无提示pecl_http安装?
我试图在我的服务器上安装pecl_http根据手册手册是为ubuntu,但作为pecl http packadge apt-cache search pecl_http返回php5-pecl-http:
sudo apt-get update
sudo apt-get install php-pear php5-dev
sudo apt-get install php5-pecl-http
sudo apt-get install libcurl3-openssl-dev
Run Code Online (Sandbox Code Playgroud)
在最后php.ini添加extension=http.so.
http_get()和我需要的http_parse_headers()函数说func是未定义的.有什么问题?
我正在寻找调试PHP脚本的方法.在互联网上我找到了可以用MacGDBp + XDebug做的信息.当我在Shell中使用PECL进行安装时:
sudo pecl install xdebug
The next error have been occured:
downloading xdebug-2.4.0.tgz ...
Starting to download xdebug-2.4.0.tgz (264,832 bytes)
.....................done: 264,832 bytes
76 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. …Run Code Online (Sandbox Code Playgroud) 我安装了pecl_http,但是当我尝试使用它时,我收到一个错误:
致命错误:未捕获错误:在/opt/lampp/htdocs/tes_http.php:3中调用未定义函数http_get()堆栈跟踪:#3 {main}在第3行的/opt/lampp/htdocs/tes_http.php中引发
这是我的php.ini配置:
extension="propro.so"
extension="http.so"
extension="raphf.so"
[PHP]
;;;;;;;;;;;;;;;;;;;
Run Code Online (Sandbox Code Playgroud)
请帮我弄清楚为什么功能不可用.