Im running some code on Atlassian Jira bug system API, here is the code im using

$username = 'xxx';
$password = 'xxx';

$url = 'https://xxx.atlassian.net/rest/api/2/issues/?filter=12202';
//$url = 'https://xxx.atlassian.net/rest/api/2/issue/bug-5555';

$curl = curl_init();
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);

$issue_list = curl_exec($curl);
$issue_json = json_decode($issue_list);
print_r($issue_json);

Thats basically all the code, now if i run that code i get a server error:

CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /usr/local/pem/vhosts/117355/webspace/httpdocs/morny.me/jira_filters.php on line 388

However if i run the commented code instead:

$url = 'https://xxx.atlassian.net/rest/api/2/issue/bug-5555';

That works fine with no issues.

To be honest i have no idea what the problem is so i sent an email to my hosting company

Hi Paul,

The safe_mode is disabled across our servers by default. Please bear in mind that the link you provided for second solution describes single site manual configuration, this is not something we would perform on the shared hosting.

When i try to access the conf folder or the .htaccess file or anything outside the httpdocs folder it says i dont have permission so looks like im limited on what i can change.

Is there any workaround?

1

There are 1 best solutions below

0
On

Use YQL as a proxy for the URL in question. Here is an example: