Server Php For Mac Os

I mainly do web development on my 15 in Macbook Pro. Mac runs on base Unix foundation so mainly you could install almost all Linux/Unix software on Mac very easily.

Mac

Each Mac has a built-in Apache server that runs a built-in PHP. To upgrade it you need less than 10 minutes once you have understood all the steps needed. The same applies also to install the last PHP 7.1 version: you only need to change the required version of PHP (see below). Exploring the LAMP server. Download Updated Versions: XAMPP Version 7.4.6 for OSX XAMPP Version 7.3.18 for Mac XAMPP Version 7.2.31 for Mac XAMPP is quite attractive package for Mac users, because of it being Lightweight software, simpler GUI and inclusion of Number of tools/ features with it. This is a complete package which is easy to easy install, configure. MacOS Server brings even more power to your business, home office, or school. Designed to work with macOS and iOS, macOS Server makes it easy to configure Mac and iOS devices. It’s also remarkably simple to install, set up, and manage. Add macOS Server to your Mac from the Mac. To Paste between an X11 app and a Mac OS X app, in the X11 file menu, select Edit Copy and then select Edit Paste in the Mac OS X app menu. X11 Customization and PATH export: To have the scrollbar automatically appear when a new xterm window is created from the X11 menu (and to perhaps source the shell files so that PATH's are kept, etc).

Mac OS X comes by default with ApacheWeb Server and PHP. In this tutorial we will go over steps on how to enable those on Mac.

Let’s get started:

Mac Os Php

Enable Apache Web Server

Step-1

Open terminal App and run below command:

Step-2

Php

Open browser and check with URL: http://localhost

Server

Enable PHP Module and verify Perl module

Download Php For Mac

Step-1

Open Terminal App. Mac OS X comes by default with Perl library. Just type below commands to check Perl and PHP Setup.

Terminal Commands
2
4
6
8
10
12
14
16
18
/usr/bin/perl
bash-3.2# pwd
total120
-rw-r--r--1root wheel13077Sep92014magic
drwxr-xr-x14root wheel476Sep92014extra
-rw-r--r--1root wheel20786Sep92014httpd.conf
-rw-r--r--1root wheel20786Jun913:55httpd.conf.bak
bash-3.2# vi httpd.conf

Step-2

Open file httpd.conf file. You may use any Text Editor also.

Uncomment the following line (remove #): LoadModule php5_module libexec/apache2/libphp5.so

Step-3

Server

Restart Apache Web Server:

Step-4

  • Find DocumentRoot from httpd.conf file. In my case it’s /Users/crunchify/Documents/Blogs/MAMP as I’m using MAMP on my Mac.
  • You may have diff folder something like /Library/WebServer/Documents/.
  • Create below file crunchify-php-on-mac.php under your DocumentRoot folder.
  • If you don’t see folder Web Server then just create it 🙂
crunchify-php-on-mac.php
2
4
6
8
<head>
</head>
<?phpecho'<p>Hello World - PHP Testcase on Mac OS X by Crunchify.com...</p><br>Have a fun.. Enjoy..';?>
</html>

Step-5

Now visit this URL: http://localhost/crunchify-php-on-mac.php and you should see php file loaded successfully on browser.

How to Kill Apache httpd process on Mac?

Just incase if you need to kill apache httpd process on Mac then you could use below commands.

Mac Os X Server Download

2
sudo launchctl unload/System/Library/LaunchDaemons/org.apache.httpd.plist

Enjoy and Happy coding…

Join the Discussion

If you liked this article, then please share it on social media or leave us your comments. Limited time 3 months free WPEngine hosting.

Php Server For Mac Os

Php

Php Server Mac Os X

Other Popular Articles...