Recommended Posts

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:


$ php -i
phpinfo()
PHP Version => 5.3.15
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)[/CODE]

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[/CODE]

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:[/CODE]

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

Link to comment
https://www.neowin.net/forum/topic/1143018-running-php-on-osx/
Share on other sites

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:


$ php -i
phpinfo()
PHP Version => 5.3.15
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)[/CODE]

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[/CODE]

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:[/CODE]

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

What user are you running PHP as?

Tip: Look for PHP and Linux. Will give you much more results as OS X is basically unix (and Linux is basically unix)

I've gone through the same problems too. I usually work with Homebrew to take care of getting the latest possible stables of PHP, MySQL and possibly even MongoDB. They can be a version behind sometimes.

I'd recommend working with Linux Ubuntu Server on a VirtualBox because you can do it all from scratch while having the internet bridged by using eth0 (Ethernet), I believe it won't work well through WiFi.

VirtualBox seems overkill for a little local development, OSX comes with PHP out of the box which i believe is the 5.3 instance... as far as a bit of coding goes it works fine as is, i can add error_reporting(E_ALL ^ E_NOTICE) to remove the undefined index notices.. but yeah, would like to try a newer version if possible.

Not sure what you mean by what is it running as? I just installed the 5.4 binary i believe? not sure about 5.3?

I've worked most of it out.

OSX installation of PHP is in /usr/bin/php/ cant be removed, the secondary install is from http://php-osx.liip.ch and is installed in /usr/local/php5/

php -i calls the default version so adding export PATH=/usr/local/php5/bin:${PATH} to the bash profile file overwrites it, i'm now getting a loaded php.ini file and correct information. I can also upgrade to php 5.5 by using the following command curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5

no need for any external software it's all running nicely in the background :)

This topic is now closed to further replies.
  • Posts

    • Windows 11 gets useful new File Explorer features in the latest build by Taras Buria Friday Windows 11 preview builds are finally here. After skipping one week, Microsoft is back to releasing preview builds for Windows Insiders to try. This time, Insiders in the Experimental Channel can download build 26300.8687. Its changelog does not contain anything major, but there is still useful new stuff, such as some new conveniences for File Explorer, Windows Update improvements, better Windows Search, a new search provider for the built-in GIF library, and more. Here is the changelog: [Windows Update] As announced in the Windows Update announcement blog, we are now bringing a new unified update experience to reduce the number of reboots you see per month. We are starting by coordinating driver, .NET, and firmware updates to align with the monthly quality update, reducing the update experience to a single monthly restart. See the blog for more information. [File Explorer] Middle-click to open a folder in a new tab is now supported in the Address Bar and the Home page for a more consistent and efficient tabbed navigation experience across File Explorer. Improved screen reader announcements for conflict resolution dialog ("Which files do you want to keep?") when moving/copying files. Made some more improvements to how File Explorer responds to increased text scaling. [Search] Finding apps is more forgiving. Search is better at handling typos, dropped letters, extra letters, and partial words for apps. Queries like “utlook” can still find Outlook. Settings results are improving. We’ve made ranking improvements to help more relevant settings appear higher in results. [Taskbar] Improved reliability of loading the system tray area of the taskbar. Fixed an issue where tooltips might unexpectedly appear on top of the Start menu icon in the taskbar when using the taskbar in an alternate position. Also fixed a few other visual polish issues when using the taskbar with small icons. [Windows setup] The digital safety of users and supporting families is central to how we think about the Windows experience. We're improving information on parental controls and their availability during Windows setup, so families can more easily understand available protections and make informed choices from the very beginning. [Input] Update: The emoji panel (Windows key + period (.)) now uses GIPHY as the GIF provider, delivering a smoother GIF browsing and sharing experience following the deprecation of Tenor. Fixed an issue that was causing the mouse cursor to potentially move in the wrong direction in recent Insider builds on secondary monitors when set to portrait mode. [Remote Recovery Management] Adding a recovery remote management plug-in for extending WinRE management capabilities for MDM providers [Audio] Fixed an issue resulting in audio not working for some Insiders after the latest flights. [Settings] Fixed an issue impacting the reliability of Settings > Apps > Installed Apps after the latest flights. [General Reliability] If you were experiencing freezes in the previous flight when interacting with search, Notepad, or certain other scenarios, that should be resolved now. [Other] When using dark mode, if you open "Run new task" from Task Manager, it will now show in dark mode too. As usual, changes above are rolling out gradually. You can find the release notes here in the official documentation.
    • Im in Ohio, and my VPN endpoint is in Boston. If that helps, it does happen both on and off the VPN. and again only in Edge.
    • It is such a shame. I used to really respect Neowin's articles.
    • So.... slower fixes and slower security updates are preferred? I mean, there is no goldilocks zone here until it can literally update without ever needing a restart, and even then I'm sure someone would complain.
  • Recent Achievements

    • One Month Later
      Clizby earned a badge
      One Month Later
    • One Month Later
      Timaximus earned a badge
      One Month Later
    • Week One Done
      Timaximus earned a badge
      Week One Done
    • Rookie
      FBSPL went up a rank
      Rookie
    • First Post
      davidbazooked earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      490
    2. 2
      PsYcHoKiLLa
      168
    3. 3
      +Edouard
      163
    4. 4
      Steven P.
      85
    5. 5
      ATLien_0
      76
  • Tell a friend

    Love Neowin? Tell a friend!