Notice: Undefined variable: errno in drupal_http_request() (line 829 of ***.com/httpdocs/inclu

用drupal做了一個網站,在本機開發和測試都沒出現這個警告,發佈到萬網的阿里雲服務器上後,出現瞭如題的錯誤。google+drupal官網,說是因爲安全原因引起的,服務器提供商沒有開啓一個叫要stream_socket_client()的函數,去萬網的控制面板查看php函數設置,沒有這個函數,倒是看到一個fsockopen的函數默認被禁用了。

 

試着打開這個函數,然後刷新網站,警告消失了。

 

官網上看到的一段話,記一下

 

Notice: Undefined variable: errno in drupal_http_request() (line 829 of /foobar.com/includes/common.inc).
Notice: Undefined variable: errstr in drupal_http_request() (line 830 of /foobar.com/includes/common.inc).

In my case (as it turns out), my hosting provider had disabled a whole basket of php functions (41 in total) for security reasons. One of the disabled functions was stream_socket_client().

My host provider was kind enough to enable this function (after I told them it was now part of Drupal 7 core) but they offered the opinion that this was a security compromise.

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章