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 8651405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:03:47+00:00 2026-06-12T14:03:47+00:00

I am using Facebook SDK to post some test wall post on my own

  • 0

I am using Facebook SDK to post some test wall post on my own facebook page. It works fine when i run the script on my browser but when i run it from terminal it gives me as error as below, i don’t know what’s wrong please help. I want to post on my facebook page using php CRON scripts like every 6 hours.

Undefined index: HTTP_HOST error in Facebook/src/base_facebook.php

  • 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-12T14:03:48+00:00Added an answer on June 12, 2026 at 2:03 pm

    The cron executes the PHP not like a module of apache, so many environment variables are not set by the server. When executing from cron your PHP script is like GCI one, more precisely its CLI (command line interface – php-cli). So as you can imagine, there is no web server and there is no HTTP_HOST.

    PS: You can transfer data (urls, hostname or whatever you like) as command line arguments (environment variables) to PHP: Command line usage

    Addition:

    $php -f cronjob.php HTTP_HOST=www.mysite.com #example
    
    
    <?php
        // cronjob.php
        $host = $_GET['HTTP_HOST']; // Get the host via GET params
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to post a message on my friends wall using facebook sdk 3.0.
I'm using facebook-android-sdk to post messages to my wall. The following request: Bundle params
I have been using the Facebook Javascript SDK to post content from a CMS
using Facebook Javascript SDK (since FBml doesn't work anymore), posting to a wall using
I'm using Facebook JS SDK to develop a Facebook Page Tab application. There is
I'm using the Facebook iOS SDK to post videos from my app to the
I am using c# facebook sdk. I am trying to delete a facebook post
I try to post my image link to Facebook fan page using Facebook C#
I'm trying to use the Facebook C# SDK to post to a Facebook page
I get exception when i try to post to facebook.I am using facebook sdk

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.