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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:06:24+00:00 2026-05-11T20:06:24+00:00

I think that a function called phpinfo is a function displaying environment of PHP,

  • 0

I think that a function called phpinfo is a function displaying environment of PHP, but results of phpinfo which I carried out from a command-line as a result of phpinfo that I displayed it on a Web server are different.
Why will these be different?
I want to become the same result.

  • 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-11T20:06:24+00:00Added an answer on May 11, 2026 at 8:06 pm

    PHP called from your webserver can be configured very differently from your command line PHP.

    It depends on your webserver setup. If you have your webserver simply call your /usr/local/bin/php(or similar) binary then you will have mostly identical output(except without any of the CGI environment variables such as HTTP_HOST, REFERRER, etc.

    On the other hand, if you are using mod_php with apache or php through fast-cgi, your phpinfo will return different values, as mod_php is a separately compiled module for php. It does not call the standard php command that you access through the command line.

    Another possible reason for the differences are that your webserver is using a different php.ini file. The php.ini file tells php what extensions to load, and basically can set most of the parameters that are found on a phpinfo() page.

    It will be hard to make these the same result, unless you can configure your webserver to not send any HTTP headers through to your PHP script, and make sure your php setup for your webserver matches(or directly calls) your command line php build. You can ensure that the php.ini files are the same– phpinfo() contains the name of the currently loaded configuration file.

    I don’t think you’ll be able to get them identical regardless, and I don’t understand why you want the output to be identical. If you want the settings to be similar, you will want to edit the respective php.ini file to change the settings to what you would like them to be. Also, if you don’t have access to the php.ini file, you can use the php function ini_set() to set some configuration varibles at run time.

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

Sidebar

Ask A Question

Stats

  • Questions 120k
  • Answers 120k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The equivalent C code looks like this: #include <stdio.h> #include… May 12, 2026 at 12:05 am
  • Editorial Team
    Editorial Team added an answer Use the TimeZoneInfo class found in System.Core; You must set… May 12, 2026 at 12:05 am
  • Editorial Team
    Editorial Team added an answer I'm not completely certain I know what you're trying to… May 12, 2026 at 12:05 am

Related Questions

I want to scrape the user pages of SO to give the owners of
Consider a SQL Server 2005 database with a bunch of data on a lot
I have got a C function in a static library, let's call it A,
Sadly, I have a legacy PHP4 system that I continuously need to add features

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.