SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: PHP on OSX

  1. #1
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP on OSX

    I'm wanting to update the local version of PHP on my Mac.. i've been doing some digging and got a little confused.

    If i run php -i from the terminal it says:

    Code:
            $ php -i
            phpinfo()
            PHP Version => 5.3.15
            Configuration File (php.ini) Path => /etc
            Loaded Configuration File => (none)
    I was sure i had 5.4 installed so ran phpinfo();

    Code:
            PHP Version 5.4.5
            Loaded config file: /usr/local/php5/lib/php.ini
    A problem i'm having is i can't seem to make any php.ini file work, i'm getting lots of

    Code:
            Notice: Undefined index:
    errors, so error reporting is too high, but no matter how many php.ini files i find and edit it's not taking effect..

    I have no idea which version of PHP is being used or why there is two.

    Is it possible to disable or remove one of them so i know exactly whats going on, and then i can update it to a newer version?

    Thanks

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,234
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    okay, you have two versions installed (this is true for linux too).

    First you need to establish where php5 is located and where it's configuration files are at (try running whereis php5) -- mine is located at /etc/php5.
    Next you need to edit the php.ini that is inside the configuration folder (there may be an apache2, cli, and conf.d folder inside the php5 configuration folder).

    Open the appropriate php.ini and find the following:
    PHP Code:
    error_reporting 
    Personally, I like my dev machine reporting too much, as that will only help you write better code. However, if that is not what you want, change it to E_ALL & ~E_NOTICE

  3. #3
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    okay, you have two versions installed (this is true for linux too).

    First you need to establish where php5 is located and where it's configuration files are at (try running whereis php5) -- mine is located at /etc/php5.
    Next you need to edit the php.ini that is inside the configuration folder (there may be an apache2, cli, and conf.d folder inside the php5 configuration folder).

    Open the appropriate php.ini and find the following:
    PHP Code:
    error_reporting 
    Personally, I like my dev machine reporting too much, as that will only help you write better code. However, if that is not what you want, change it to E_ALL & ~E_NOTICE
    hmm thats strange i managed to find it in /usr/local/php/lib/php.ini - modified and it worked, strange thing is i modified it yesterday and it didn't work?

    is it easy enough to upgrade this 5.4 installation to 5.5?

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,234
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    It doesn't surprise me that the location of your ini file was different, mine was based on Linux setups, so I was sure yours would still be different, just didn't know how much different (another thing to keep in mind is if you want Apache to see the difference you have to restart apache).

    As for 5.5, that is still very much in beta and likely doesn't have binaries for all operating systems yet, so unless you are comfortable with building from source or you desperately need a feature from 5.5, I'd recommend using 5.4 for now.


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
  •