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

    • Any Video Converter Free 9.2.3 by Razvan Serea Any Video Converter is an All-in-One video converting tool with an easy-to-use graphical interface, fast converting speed and excellent video quality. Any Video Converter supports all popular video formats and converts your videos to different video formats including MP4, MOV, MKV, M2TS, M4V, MPEG, AVI, WMV, ASF, OGV, WEBM, and more. It supports converting videos to customized percent (50%, 100%, 200%, and more) or resolution (480p, 720p, 1080p, 4K, and more); It supports encoding videos into x264, x265, h263p, xvid, mpeg, wmv, and more. Any Video Converter Free key features: Compatible with Windows 11/10/8.1/8/7 (32-64bit) User interface are available in 14 languages Convert all kinds of video formats including high-definition videos Extract audio from any videos and save as MP3/WMA for your mp3 player Take snapshot from any videos and build your own picture collection Support high-definition for both input and output Batch add videos from hard drive and batch convert Customize output parameters completely as you like Manage your output videos files by group or output profile Merge several video files into a single and long one Clip a video into segments Free Audio Filter: Adjust audio volume and add audio effects Crop frame size to remove black bars and retain what you want only Adjust the brightness, contrast, saturation Rotate or flip or add noise/sharpen effects Produce output video with subtitles of your own dialogue and much, much more... Any Video Converter Free 9.2.3 changelog: Fixed video download engine auto-update failures. Added custom speed control support in the speed change tool. Added support for downloading YouTube AI-generated subtitles. Added support for preserving original audio stream in the format convert tool (e.g., Dolby Atmos, DTS:X). Fixed other bugs and improved overall performance. Download: Any Video Converter Free 9.2.3 | 7.6 MB (Freeware) View: Any Video Converter Free Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Not sure what country you’re in but in many countries you can absolutely jail the sellers behind businesses… in fact I’d say in most countries you can do that
    • I guess we are done since you refuse to read my comment you replied to or my other comment in another thread you were also a part of here.
    • I hate Slack, but Teams is much worse - maybe they've already optimized it, but it was a huge slog the last time I've checked about half a year ago. I miss my Skype.
    • Just ended up switching to Ubuntu. Not sure why I waited.
  • Recent Achievements

    • Dedicated
      jordanspringer earned a badge
      Dedicated
    • Rookie
      Rimplesnort went up a rank
      Rookie
    • One Year In
      Markus94287 earned a badge
      One Year In
    • One Month Later
      Markus94287 earned a badge
      One Month Later
    • Week One Done
      Markus94287 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      510
    2. 2
      +Edouard
      173
    3. 3
      PsYcHoKiLLa
      155
    4. 4
      ATLien_0
      91
    5. 5
      Steven P.
      79
  • Tell a friend

    Love Neowin? Tell a friend!