cPanel, CURL and curl_exec to self issue

InteractM

Well-Known Member
Apr 2, 2013
135
1
18
cPanel Access Level
Root Administrator
Hi,

I have moved site from another server running PLEKS to the server with cPanel. Both servers have installed PHP 5.2.17 with CURL support but after site move to cPanel site is crashing on curl_exec to "self" (part of the web site with blog CMS).

Code for that part looks like:

PHP:
							# INSTANTIATE CURL.
							$curl = curl_init();

							# CURL SETTINGS.
							curl_setopt($curl, CURLOPT_URL, "http://www.mydomain.com/news/index.php?tempskin=_rss2");
							curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
							curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);

							# GRAB THE XML FILE.
							$xmlData = curl_exec($curl);

							curl_close($curl);

							# SET UP XML OBJECT.
							$xmlObjData = simplexml_load_string( $xmlData );

							$tempCounter = 0;

							foreach ( $xmlObjData->channel->item as $item )
							{                    
								# DISPLAY ONLY 10 ITEMS.
								if ( $tempCounter < 10 )
								{
									echo "<li><a href=\"{$item -> link}\">{$item -> title}</a></li>
							";
								}

								$tempCounter += 1;
							}

							 ?>
Any clue why cPanel server can't handle that?

PS.
EasyApache profile details returns that:
CurlSSL
This option will make the following changes to your profile prior to the build:

Disables:
Curl

Thanks
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello :)

Is this a specific PHP application that you are using, or is it a custom-developed script?

Thank you.