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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:14:48+00:00 2026-06-04T21:14:48+00:00

The php that run on the webserver and the CLI version is not using

  • 0

The php that run on the webserver and the CLI version is not using the same php.ini file. If I do a command php --ini, it show this

Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         C:\wamp\bin\php\php5.3.8\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

while my web version uses the php.ini in C:\wamp\bin\apache\Apache2.2.21\bin\php.ini. This is probably very common for people using wamp.

How do I change the Loaded Configuration File to read from C:\wamp\bin\apache\Apache2.2.21\bin\php.ini so I don’t have to maintain 2 different php.ini versions?

  • 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-04T21:14:50+00:00Added an answer on June 4, 2026 at 9:14 pm

    Per http://php.net/configuration.file:

    php.ini is searched for in these locations (in order):

    • SAPI module specific location (PHPIniDir directive in Apache 2, -c command line option in CGI and CLI, php_ini parameter in NSAPI, PHP_INI_PATH environment variable in THTTPD)
    • The PHPRC environment variable. Before PHP 5.2.0, this was checked after the registry key mentioned below.
    • As of PHP 5.2.0, the location of the php.ini file can be set for different versions of PHP. The following registry keys are examined in order:
      • [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z], [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP major, minor and release versions. If there is a value for IniFilePath in any of these keys, the first one found will be used as the location of the php.ini (Windows only).
      • [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows only).
    • Current working directory (except CLI).
    • The web server’s directory (for SAPI modules), or directory of PHP (otherwise in Windows).
    • Windows directory (C:\windows or C:\winnt) (for Windows), or –with-config-file-path compile time option.

    For CLI, your best bet is probably either to set the $PHPRC environment variable for the account that will be executing scripts, or recompile PHP with a different --with-config-file-path configuration setting.

    You can also override the php.ini search dir on a per-execution basis by specifying the -c option when invoking PHP:

    > php --help
    Usage: php [options] [-f]  [--] [args...]
    ...
      -c | Look for php.ini file in this directory
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script launched from a command-line (aka CLI mode, no webserver
I have some long-running CLI PHP scripts that run regularly via cron. I'd like
I know there are many posts about using CRON to run a php file.
I have a php file that needs to be run on a cronjob and
I want to run PHP code as a test without using my own webserver.
I have a php script that is run once a minute. The script runs
I have a PHP page that I run every minute through a CRON job.
I'm writing a PHP process that will run on a Unix machine that will
I wrote a php script that must be run on the php interpreter (Without
Is there a query to run in php that would let you insert 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.