简体   繁体   English

PHP:为什么PHP-Curl不能与nginx一起使用

[英]PHP :Why PHP-Curl is not working with nginx

I recently moved my website to a nginx server. 我最近将我的网站移动到nginx服务器。 My python code is running on the same machine on 8086 port, but my php curl module is not working. 我的python代码在8086端口上的同一台机器上运行,但我的php curl模块无法正常工作。 I don't know what I am doing wrong here. 我不知道我在这里做错了什么。

I already installed php5-fpm , but stil not able to resolve this issue. 我已经安装了php5-fpm ,但是stil无法解决这个问题。 I can not see the error also because nginx simply shows me the blank screen. 我也看不到错误,因为nginx只是向我显示空白屏幕。 Btw. 顺便说一句。 it is printing all the values before curl_init() statement. 它在curl_init()语句之前打印所有值。

I can post my Nginx configuration also but i don't think so that is required. 我也可以发布我的Nginx配置,但我不认为这是必需的。

你需要运行/etc/init.d/php5-fpm restart

If you are on Windows, make sure to follow the below steps: 如果您使用的是Windows,请务必按照以下步骤操作:

  1. Rename php.ini-production or php.ini-development to php.ini php.ini-productionphp.ini-development重命名为php.ini
  2. Specify the extension directory: extension_dir = "ext" 指定扩展目录: extension_dir = "ext"
  3. Enable the Curl extension (Uncomment in php.ini): extension=php_curl.dll 启用Curl扩展(在php.ini中取消注释): extension=php_curl.dll

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM