Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:38:44+00:00 2026-06-03T14:38:44+00:00

I am creating a custom helper in ./application/helpers however i am getting this error

  • 0

I am creating a custom helper in ./application/helpers however i am getting this error

Unable to load requested file helpers/curl_helper

This is the code in my helper file:

    function send(array $request, $url, $method)
{
    //Validating if the required extensions are installed or not
    if( !function_exists('json_encode') )   return false;
    if( !function_exists('curl_init') )     return false;

    //Converting the array into required json format
    $request = json_encode($request);

    //Setting header required for requests
    $header[] = "Content-type: application/json";
    $header[] = "Content-length: ".strlen($request) . "\r\n";

    //If the request method is get append the data into requests header
    if( $method == 'GET' or $method == 'get' )      $header[] = $request;

    //Initializing curl
    $ch = curl_init();
    //Setting curl options for request
    curl_setopt( $ch, CURLOPT_URL, $url);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
    curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, $method );

    //If the request method is post add the data we need to enable post 
    //request and define the data in post fields
    if( $method == 'POST' or $method == 'post' ) {
        curl_setopt( $ch, CURLOPT_POST, 1);
        curl_setopt( $ch, CURLOPT_POSTFIELDS, $request);
    }

    //Executing the curl request and storing the result in a variable
    $result = curl_exec( $ch );
    //Closing curl conneciton
    curl_close($ch);

    return json_decode($result);
}

And i am loading it in my library like:

$this->loader =& get_instance();
$this->loader->load->helper('curl');

Tell me where i am doing wrong?

UPDATE:
After trying too many things when i put the function in the same library where i want to use i found that there is an error in the line

curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );

when i comment this line function works fine. I dont know where is the error please help me. And as far as i think this is the reason for loader error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:38:46+00:00Added an answer on June 3, 2026 at 2:38 pm

    Well, if you are using the "MY_helpername" then do check if you named the file on your server as “my_helpername“, I don’t know the reason but CI will look for my_helpername.php in helpers folder but not MY_helpername. I have this issue in past and changing the name on my linux box from MY_helpername to my_helpername worked for me.

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a custom drag helper (in jQuery): $('.dragme', element).draggable({ appendTo: 'body', helper :
I am creating custom membership provider for my asp.net application. I have also created
I've come across two recommendations for creating custom html helpers: either extend an existing
I'm creating custom table view cells, but result is incorrect. My code: - (UITableViewCell
There are two ways of creating a custom HTML helper in ASP.NET MVC: You
I am creating a page-based WPF application using MVVM. I have created a custom
I started creating a custom library that i would load for checking if user
I just started with creating custom objects in javascript. I want to set this.someObjVar
I am creating custom html helper for my datepicker. i want to pass inside
I am creating my own helper in MVC. But the custom attributes are not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.