linux中开启了allow_url_fopen仍然无法使用file_get_contents获取url内容
作者:大鹏 发布于:2013-7-16 19:40 Tuesday
分类:Unix & Linux
标签: php linux lnmp
file_get_contents函数多用来于来采集远程服务器上的内容,但使用file_get_contents函数之前我们在php.ini中是必须把allow_url_fopen开启才行。
问题描述
fopen(),file_get_contents(),getimagesize() 等都不能正常获得网络上的内容,具体表现为凡参数是URL的,一律返回空值
如果是windows可找开
allow_url_fopen开启
如果是否linux中可以
重新编译PHP,去掉–with-curlwrapper 参数——编译前记得先执行 make clean。
php 5.4.5编译问题
作者:大鹏 发布于:2012-8-9 8:48 Thursday
分类:Unix & Linux
标签: php apache mysql linux
以下是我编译php5.4.5的配置参数(环境:CentOS 6.3, MySql 5.5.25a, apache 2.4.2 所有版本都是目前最新的):
./configure --prefix=/usr/local/php5/ --with-config-file-path=/usr/local/php5/etc/ \ --with-apxs2=/usr/local/apache2/bin/apxs --with-mcrypt=/usr/local/libmcrypt/ \ --enable-soap --enable-mbstring=all --enable-sockets \ --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \ --with-libxml-dir=/usr/local/libxml2/ \ --with-gd --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/