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

  • Home
  • SEARCH
  • 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 3421704
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:07:58+00:00 2026-05-18T06:07:58+00:00

I have a question about cURL. I am using cURL with this function: curl_setopt($ch,

  • 0

I have a question about cURL. I am using cURL with this function:

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

Only this was causing an error: “Message: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set”

So I asked my hosting provider to fix this, and they did. But, and this is really stupid, they put a “curl” file in my bin directory. And I have no idea how to include this in my php script :S.

Never done it before, but can anybody help me. I am really stuck. I hope I posted enough info!

Tnx in advanced!


Tnx for all the great replies. But How would I fit “exec()” in this code?

    // create a new cURL resource
    $ch = curl_init();

    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_TRANSFERTEXT, TRUE);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($ch, CURLOPT_URL, $articleUrl);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_MAXREDIRS, 5);

    // grab URL and pass it to $grabArticle
    $grabArticle = curl_exec($ch);

Edit 2:
Oké, I almost got it working :). It is working just fine when I run it in putty, but in my php script nothing happens 🙁

I run this:

$grabArticle = exec('/home/twittern/bin/curl -L -m 30 -w url_effective --max-redirs 5 http://fok.nl/415758');
echo $grabArticle;

Any thing I am doing wrong?

  • 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-05-18T06:07:58+00:00Added an answer on May 18, 2026 at 6:07 am

    Instead of using the built-in cURL functions within PHP, they are asking you to use the external command-line version.

    Use the PHP exec() function to call the program, the command line options can be found on the curl man page.

    Given that you probably need the response in full, you may need to use passthru() with output buffering or save the output to a (temporary) file.

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

Sidebar

Related Questions

I have a question about this formula from a book: EFW (cm,kg)= 10^(-1,7492+(0,166*BPD)+(0,046*AC)-(2,646*AC*BPD/1000)) The
I have question about how I can save the result of function I have
This question talks about using the system command and passing variables. Here is an
Have a question about calling one prototype function in another prototype function. for instance
I have question about this plugin system: .NET 4.0 ASP.NET MVC 3 plug-in architecture
I have a question about this on testing the following code: 1, def file_close_test():
I have a question about this script I found and used. It works but
I have question about parsing in Html helper : I have sth like: @foreach
I have question about clean thory in Python. When: @decorator_func def func(bla, alba): pass
I have question about XSLT1.0. The task is to write out in HTML all

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.