1. Install Php For Mac Windows 7
  2. Install Php Mac Command Line
Php

You need to make sure you have the Apple Developer Tools, BSD Subsystem, and an installation of X before you try installing PHP-GTK 2. Although the BSD subsystem is installed by default on Mac OS X, you need select the Developer Tools and X Server manually. Although you can use any X server, the easiest would be to use the one Apple provides by default on it's Mac OS X installer.

Get MacPorts (previously knows as DarwinPorts) or Fink and install it. You can use either to install a version of X (if you decided not to use Apple's default distribution), and Gtk+ itself. Both Fink and MacPorts provide versions 2.6 and above of Gtk+. Also make sure you have a version of PHP that is atleast 5.2, MacPorts provides a package. Type php -v on your Terminal to find out your version. If you want to manually compile PHP you can do so: Although you may install it anywhere, /usr/local/ is usually considered a good place. MacPorts installs PHP into /opt/local/.

Now get the latest checkout of PHP-GTK and compile it: Remember to replace /usr/local/ with the actual directory in which you installed PHP. For example, if you installed PHP 5.2 using MacPorts, you would enter /opt/local/ instead.

Install Php For Mac

Install Php For Mac Windows 7

Finally, copy over the php.ini-recommended file to /usr/local/lib/php.ini and change the value of extension_dir to the directory where php_gtk2.so resides. This is usually something like: /usr/local/lib/php/extensions/no-debug-non-zts-some-date. You may want to create a new symbolic link in /usr/bin/ that points to /usr/local/bin/php. Again, the directory may be /opt/local/ instead of /usr/local/ depending on where your installation of PHP resides.

  • In this tutorial we will learn to install Apache, MySQL, PHP on macOS Mojave 10.14. Apple released the new macOS Mojave 10.14 on 24th September 2018 and it includes Apache and PHP. We will be using the pre-installed Apache and PHP and we will download and setup MySQL database.
  • Installing Apache, PHP, and MySQL on Mac OS X Main Thread October 9, 2012. 5 min read macOS Update: While these instructions still work, there are new posts for recent versions of macOS, the latest being Install Apache, PHP, and MySQL on macOS Mojave.

Install Php Mac Command Line

Command

Now continue with Testing your installation.

I installed php 7.2, even though it's not the latest, simply because my hosting site and wordpress uses php 7.2 and I want to integrate my php application with my wordpress site. $ brew install php@7.2 Once php is installed, go back to your httpd.conf file and add the following line.