SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php --ini vs phpinfo() (which one is more valid?)

    When I run php --ini at my terminal screen I get :
    Loaded Configuration File : /usr/local/lib/php.ini

    On the other hand when I load in on my browser a php file containing only the phpinfo() function I get the following :
    Loaded Configuration File : /etc/php.ini

    Which one of the two php.ini files is being used by php?
    Thank you.

  2. #2
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most likely explanation when you access php from terminal you are actually using a different php - not the same as your web browser is using.
    This is actually pretty common to have 2 independent installations of php - one as apache module and one as a stand-along cgi version.

    The answer is - when you access your php from web browser the /etc/php.ini is used (in your case)
    My project: Open source Q&A
    (similar to StackOverflow)
    powered by php+MongoDB
    Source on github, collaborators welcome!

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for answering.Check my other question here (http://stackoverflow.com/questions/1...-restarting-it) about my failed effort to enable display_errors in /etc/php.ini
    This question has not find an answer for a long time.

  4. #4
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Strange that. You're certain the changes to /etc/php.ini saved?

    Are there any other scripts running before you get to your page? It could be that errors are being turned off in one of those scripts. Also, have you checked the php.ini file to make sure display_errors only appears once?

    Doesn't make sense on the surface - if you change the correct php.ini file to display_errors = on and restart apache, error reporting should be turned on. Can you paste your script?

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aaarrrggh : You were right!I've found another line that set display_errors to off , after my setting.
    If you are a member of stackoverflow, answer my question to get the credits!

  6. #6
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by skiabox View Post
    aaarrrggh : You were right!I've found another line that set display_errors to off , after my setting.
    If you are a member of stackoverflow, answer my question to get the credits!
    Haha, I'm not a member of stackoverflow. Maybe I'll sign up and have a go eh? :-)

  7. #7
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    There you go. I signed up - username: citypaul :-)

  8. #8
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just accepted your answer there.Thank you so much for your help!

  9. #9
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Glad to be able to help :-)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •