卷曲导致apache错误

时间:2022-02-28 06:32:38

I'm a bit stuck, curl causes segmentation faults in apache and I can't find out why.

我有点卡住,卷曲导致apache中的分段错误,我无法找到原因。

I made a simple case, trying to understand :

我做了一个简单的案例,试图理解:

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://google.fr');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_exec($ch);

My conf, apache2, php5.3, ubuntu 11.10. Tried to reinstall php5-curl with no success

我的conf,apache2,php5.3,ubuntu 11.10。试图重新安装php5-curl但没有成功

If you have ever seen this before, and have an idea please tell me !

如果您以前见过这个,并且有想法请告诉我!

1 个解决方案

#1


0  

Have you tried adding curl_close($ch); as last line in your example?

你有没有尝试添加curl_close($ ch);作为你的例子中的最后一行?

Still, it shouldn't segfault ;) Try running the code manually like this: php test.php

不过,它不应该是段错误;)尝试手动运行代码,如下所示:php test.php

#1


0  

Have you tried adding curl_close($ch); as last line in your example?

你有没有尝试添加curl_close($ ch);作为你的例子中的最后一行?

Still, it shouldn't segfault ;) Try running the code manually like this: php test.php

不过,它不应该是段错误;)尝试手动运行代码,如下所示:php test.php