1.在PHP使用file_get_contents抓取https页面是老是返回null 抓取http正常 ,随后查了需要开启php_
openssl 看了oneinstack php etc目录下和include/php/etc下都没有
openssl扩展文件 自己从官网下了扩展包应该如何安装呢?
求帮忙,感激不尽
2.另外请问在PHP文件中开启了报错信息但是网页不输出错误必须得把php.ini display_errors = on 才行
如何能做到php.ini设置display_errors = off, 在php文件中又能输出报错信息? 求帮忙,感激不尽
ini_set("display_errors", "On");
error_reporting(E_ALL);
ini_set("display_errors", "On");
error_reporting(E_ALL) 无效
必须得把php.ini display_errors = on 才行
如何能做到php.ini设置display_errors = off, 在php文件中又能输出报错信息? 求帮忙,感激不尽
;
./addons.sh 如果没找到,相关编译参考:
https://oneinstack.com/question/oneinstack-how-to-support-the-fileinfo/
[root@iZ2zebdod77u1dnxo59qweZ openssl]# /usr/local/php/bin/phpize
Cannot find config.m4.
Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module
cd /root/oneinstack/src
tar zxvf php-5.6.20.tar.gz # 解压已经安装的php版本
cd php-5.6.20/ext/fileinfo
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
cd /usr/local/php/lib/php/extensions
ls #看到no-debug-non-zts-20131226类似文件夹
cd no-debug-non-zts-20131226
ls #查看有没有 fileinfo.so,如果有,证明编译成功
加载fileinfo
echo 'extension=fileinfo.so' > /usr/local/php/etc/php.d/ext-fileinfo.ini
file_get_contents('http://www.baidu.com')正常
apache报错
[Sat Jun 17 10:48:26.377906 2017] [:error] [pid 22828] [client 42.236.205.130:11481] PHP Warning: file_get_contents(https://www.baidu.com): failed to open stream: operation failed in /data/www/JianGuo/index.php on line 45
[Sat Jun 17 10:48:40.171397 2017] [:error] [pid 22832] [client 42.236.205.130:11647] PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /data/www/JianGuo/index.php on line 45
[Sat Jun 17 10:48:40.171453 2017] [:error] [pid 22832] [client 42.236.205.130:11647] PHP Warning: file_get_contents(): Failed to enable crypto in /data/www/JianGuo/index.php on line 45
[Sat Jun 17 10:48:40.171519 2017] [:error] [pid 22832] [client 42.236.205.130:11647] PHP Warning: file_get_contents(https://www.baidu.com): failed to open stream: operation failed in /data/www/JianGuo/index.php on line 45
Please login or Register to submit your answer