Xampp For Mac Os Catalina

I downloaded the most recent version which is for Mac OS X operating system (I have Mac OS Catalina) and no such file path is available with the most recent version of XAMPP for MAC. The only way I have access to the files is by starting XAMPP, running the programs, then. XAMPP is a free distribution package that makes it easy to install Apache Web Server, PHP, PEAR, and MySQL. Before installing XAMPP, you should turn off any other web servers and instances of MySQL you have running on your Mac. Installing XAMPP on a Mac. Download XAMPP for Mac OSX - Be sure to select the proper version of PHP. Disk Cleaner For Mac Os X Bugdom For Os X Download Xampp For Mac High Sierra Xcode Uikit For Os X Visual Studio 2010 For Mac Os X Download Powerdvd For Mac Os X Download Citrix Receiver For Mac High Sierra 10.13.4 Winrar For Os X El Capitan Nero For Mac Sierra Airport Utility For Mac Sierra Xcode For Os X Lion.

Second part in a multi-part blog series for Mac developers

Part 2: macOS 11.0 Big Sur Web Development Environment
Mac

In Part 1 of this 3-part series, we covered configuring Apache on macOS to work better with your local user account, as well as the installation process for installing multiple versions of PHP.

In this Part 2, we will cover installing MySQL, Virtual Hosts, APC caching, YAML, and Xdebug. After finishing this tutorial, be sure to check out how to enable SSL in Part 3 of the series.

11/13/2020 Updated to reflect the release of macOS 11.0 Big Sur
12/02/2019 Updated to reflect the latest release of PHP 7.4 and the removal of PHP 7.1 from Official tap
12/02/2019 Updated to reflect the latest release of PHP 7.4 and the removal of PHP 7.1 from Official tap
10/08/2019 Updated to reflect the release of macOS 10.5 Catalina
01/10/2019 Updated to add back PHP 5.6 and PHP 7.0 from and external deprecated keg
12/12/2018 Updated to reflect the latest release of PHP 7.3 and the removal of PHP 7.0 from Brew.

This guide is intended for experienced web developers. If you are a beginner developer, you will be better served using MAMP or MAMP Pro.

Although not required for development of Grav, there are times you definitely need an installation of MySQL. In the original guide, we used the Oracle MySQL installation package. However, we now have switched to MariaDB which is a drop-in replacement for MySQL and is easily installed and updated with Brew. Detailed information on the HomeBrew installation process can be found on the mariadb.org site but the essentials are as follows:

Install MariaDB with Brew:

After a successful installation, you can start the server ane ensure it autostarts in the future with:

You should get some positive feedback on that action:

You must change MySQL server password and secure your installation. The simplest way to do this is to use the provided script:

Just answer the questions and fill them in as is appropriate for your environment. You can just press return when prompted for the current root password.

Download TablePlus and install it. (it's awesome and there's a free version!). You should be create a new MySQL connection, give it a Name, a color, and check Use socket option after you enter a User of root and your newly created password.

If you need to stop the server, you can use the simple command:

A very handy development option is to have multiple virtual hosts set up for you various projects. This means that you can set up names such as grav.mydomain.com which point to your Grav setup, or project-x.mydomain.com for a project-specific URL.

Apache generally performs name-based matching, so you don't need to configure multiple IP addresses. Detailed information can be found on the apache.org site.

Apache already comes preconfigured to support this behavior but it is not enabled. First you will need to uncomment the following lines in your /usr/local/etc/httpd/httpd.conf file:

and:

Then you can edit this referenced file and configure it to your needs:

This file has some instructions already but the important thing to remember is that these rules are matched in order. When you set up virtual hosts, you will lose your older document root, so you will need to add back support for that first as a virtual host.

Don't forget to change your_user for your actual username on your Mac. For example: DocumentRoot '/Users/bernard/Sites'

As you set up your .test virtual hosts, you may receive a warning such as Warning: DocumentRoot [/Users/your_user/Sites/grav-admin] does not exist when restarting Apache. This just lets you know that the source directory listed for your virtual hosts is not present on the drive. It's an issue that can be resolved by editing this file with the corrected DocumentRoot.

We used to recommend using .dev domain name, but since Chrome 63 forces all .dev domains to use SSL, this guide has been updated to use .test

In the example virtualhost we setup above, we defined a ServerName of grav-admin.test. This by default will not resolve to your local machine, but it's often very useful to be able to setup various virtual hosts for development purposes. You can do this by manually adding entries to /etc/hosts ever time, or you can install and configure Dnsmasq to automatically handle wildcard *.test names and forward all of them to localhost (127.0.0.1).

First we install it with brew:

Then we setup *.test hosts:

Start it and ensure it auto-starts on reboot in the future:

And lastly, add it to the resolvers:

Now you can test it out by pinging some bogus .test name:

Voila! we have successfully setup wildcard forwarding of all *.test DNS names to localhost.

Caching in PHP is a big part of the performance equation. There are two types of caching typically available, and both have a big impact on speed and performance.

The first type of cache is called an opcode cache, and this is what takes your PHP script and compiles it for faster execution. This alone can typically result in a 3X speed increase!.

The second type of cache is a user cache, and this is a entry that PECL adds to the top of your php.ini. So edit this file and remove the top line:

Once that line is removed, we can add a new file with a proper entry to the recently bulit apcu.so library:

Xampp control panel mac

In this file paste the following:

Restart Apache with the brew services stop httpd; brew services start httpd command to pick up your changes.

APCu for other PHP versions

For PHP 7.0 and above you can use the latest 5.x release of APCu, so the process is the same for all. First let's switch to PHP 7.0 and install the APCu library:

Restart Apache with the brew services stop httpd; brew services start httpd command to pick up your changes.

The uninstall -r enables PECL to only remove registration, it does not actually uninstall anything.

Again if you are OK with the ACPu defaults, you can leave things as-is, but you can choose to repeat the Optional APCu Configuration steps to create an APCu configuration file fore each PHP version.

For PHP 7.1, just repeat these steps but use 7.1 instead of 7.0:

For PHP 7.2:

For PHP 7.3:

For PHP 7.4:

With recent versions of Grav, we now make use of the native PECL YAML library that allow YAML processing to be done by highly efficient libYAML C library rather than by they Symfony PHP library. This can result in a 5X improvement in YAML processing times! Luckily this is a simple process to install for any PHP version:

Switch to PHP 5.6 mode, then run the following brew commands to install libyaml:

How To Use Xampp On Mac

Then you can install YAML via PECL.

For PHP 5.6 we have to install the latest 1.3.x version of YAML, as this is the last version to provide PHP 5.6 support:

Xampp for mac os catalina download

Answer any question by simply pressing Return to accept the default values

Restart Apache with the brew services stop httpd; brew services start httpd command to pick up your changes.

YAML for other PHP versions

For PHP 7.0 and above you can use the latest 2.x release of YAML, so the process is the same for all. First let's switch to PHP 7.0 and install the YAML library:

Restart Apache with the brew services stop httpd; brew services start httpd command to pick up your changes.

The uninstall -r enables PECL to only remove registration, it does not actually uninstall anything.

For PHP 7.1, just repeat these steps but use 7.1 instead of 7.0:

and for PHP 7.2:

and for PHP 7.3:

and again for PHP 7.4:

[Optional] YAML Configuration

Xampp For Mac Os Catalina Download

If you are feeling adventurous, or you like to keep things uniform, you can follow the same procedure as APCu and remove the default extension-'yaml.so' entry in each PHP's php.ini and instead, create a conf.d/ext-yaml.ini file:

One of the most important aspects of any kind of development is the ability to debug and fix your code. PHP comes with limited support to dump variables or log to a file, but for more complex situations you need something more powerful.

Xdebug provides is a debugging and profiling extension for PHP that provides an HTML-friendly output for the var_dump() method that improves the readability of the default version. It also provides other useful dumping methods as well as displaying stack traces. One of the best features however, is the ability to remote debug your code. This means you can set breakpoints, and step through your PHP code inspecting as you go. Full documentation on Xdebug contains extensive information about all the functionality available.

Xampp For Mac Os Catalina

Xdebug for various PHP versions

There are some compatibility issues we need to take into account, as certain versions of PHP can only run certain versions of Xdebug:

PHP VersionCompatible Xdebug version
PHP 5.6Xdebug 2.5
PHP 7.0Xdebug 2.7
PHP 7.1Xdebug 2.9
PHP 7.2+Xdebug 3.0

To install specific versions of Xdebug we need to switch to the PHP version we want to install it on, then run these commands:

For PHP 5.6
For PHP 7.0
For PHP 7.1
For PHP 7.2+

change sphp 7.2 to the version you want to install xdebug for (from 7.2 to 8.0)

Xdebug Configuration

Like the other PECL-installed modules, this will create a simple entry in the php.ini file, but you really need to configure Xdebug for it to be useful. So let's just go ahead and create our configuration file as we'll need it shortly anyway.

You will now need to remove the zend_extension='xdebug.so' entry that PECL adds to the top of your php.ini. So edit this file and remove the top line. In this example we will use 5.6 but it's the same procedure for each version of PHP.

Once that line is removed, we can add a new file with a proper entry to the recently bulit xdebug.so library:

For Xdebug versions prior to 3.0 (ie, PHP 5.6 through PHP 7.1) you can paste the following into the file:

However, Xdebug version 3.0 (ie, PHP 7.2+) has a simplified syntax and should look like this:

Restart Apache with the brew services stop httpd; brew services start httpd command to pick up your changes. You should check the http://localhost/info.php to ensure that Xdebug information is displayed:

if Xdebug still shows up in php -v the most likely cause is you didn't remove the zend_extension='xdebug.so' entry at the top of php.ini

Restart Apache with the brew services stop httpd; brew services start httpd command to pick up your changes.

Xdebug Switcher Script

W00fz created a great tool for quickly enabling/disabling xdebug. Install this with brew:

Using it is simple, you can get the current state with:

And then turn it on or off with:

CLI Enabled Xdebug

There are times when you want to debug from the CLI, and you can do this by setting an environment variable. My preferred approach is to use a simple script that works with all versions of Xdebug. First create a file in your user's bin/ folder (create the folder if it doesn't already exist), and call it xdebug.conf then save this:

Then ensure it's executable:

Then when you need to debug, simply run it whenever you need it:

You should now be all set with a Rockin' PHP development environment! To find out how to enable SSL on Apache, check out Part 3 in the series.

NOTE: The brew installation actually creates configuration files in /usr/local/etc/php/5.6/conf.d, /usr/local/etc/php/7.0/conf.d, /usr/local/etc/php/7.1/conf.d, /usr/local/etc/php/7.2/conf.d, /usr/local/etc/php/7.3/conf.d, and /usr/local/etc/php/7.4/conf.d respectively. If you want to uninstall a PHP extension, simply rename the .ini file to .ini.bak and restart apache. Alternatively, you can simply use brew to uninstall it, and reinstall it again when you need it.

Please enable JavaScript to view the comments powered by Disqus.

If you want to install WordPress on Mac OS X, you are always advocated using a local server environment setup tool, such as MAMP or XAMPP. In another guide, we have introduced the free web server package MAMP for Mac with steps to install WordPress on Mac OS X with MAMP. In this tutorial, we will review another free local development environment tool for Mac, XAMPP for Mac, and we will use this app to install WordPress on Mac so you can start developing websites locally, play or learn WordPress with a local WordPress installation without paying for a hosting account. You can build a WordPress site or blog locally on your computer, and transfer it to a real server when you are ready. It is a safe way to test WordPress before publishing online. If you are on Windows, do not forget to check out this guide: how to install WordPress on Windows PC?

How to Install WordPress on Mac?

To install WordPress on Mac with XAMPP is not difficult, there are several steps but just a couple tricky ones. Basically you need to download XAMPP for Mac, then install this software, after that go to download WordPress and install WordPress on Mac. Now let’s dive into the details, specifically by looking at some tricky steps.

Install XAMPP for Mac

Go to download the latest version of XAMPP for Mac from its official site here . At the time of writing, its latest version is 7.3.2. They are compatible with Mac OS X 10.6 or later. The main difference is the script or component versions, notably the PHP versions. However this does not affect our local WordPress installation. As everything with software, we recommend the more recent versions.

It’s a DMG file you will download. Double-click the file you just downloaded. Then install XAMPP on your Mac, drag the XAMPP folder to the Application folder to install it.

Launch XAMPP from the Launchpad on your Mac. Click the Start button in the General tab of the stack manager. Wait for the status icon to turn green.

Ensure that all services are running in the Services tab of the stack manager (or start them as needed). If you can’t start Apache on Mac, try to disable Web sharing from System Preferences… >> Internet & Wireless >> Sharing.

You can stop, start, restart or check the status of individual services from the Services tab of the stack manager any time you want.

Create WordPress Database in XAMPP

As we have mentioned above, local WordPress requires both PHP and MySQL. Now we need to set up a database for WordPress with XAMPP for Mac. XAMPP offers phpMyAdmin for us to manage databases. We can create MySQL database for our local WordPress installation on Mac with it. Before that, we need to enable localhost port forwarding in the Network tab.

Visit http://localhost:8080/ in Safari browser, click phpMyAdmin or directly access http://localhost:8080/phpmyadmin/ to open the web database management tool to create a database for your local WordPress site on Mac.

To create a MySQL database with phpMyAdmin on Mac, click Databases, choose & input the database name and click Create button, the MySQL database will be created and you can set up your local WordPress on Mac with it in following steps.

Now you have set up everything you need to get started developing and testing your local WordPress on Mac. Continue installing WordPress in just another couple of steps.

Download WordPress installer

Switch to the Volumes tab of the XAMPP stack manager on Mac. Click Mount button to mount the /opt/lampp directory. Then click the Explore button to open the XAMPP file manager in Finder.

Xampp For Mac Os


Download WordPress from https://wordpress.org/download/ to the ‘htdocs’ sub-folder under the above XAMPP folder. Unzip the WordPress installer, you should get a ‘wordpress’ folder.

Create WordPress database connection

From the local WordPress folder, you should see a wp-config-sample.php file, duplicate this file first, then rename this file to wp-config.php and edit the connection to WordPress database from there. Remember that we have already created a MySQL database with phpMyAdmin above? Now we need to set up a connection between the WordPress files and its database, or we can say to link the Apache server and MySQL server.

Open this configuration file with a text edit, such as the TextEdit, on Mac, you will find a section of this php file like below image:

To create database connection for your local WordPress on Mac, you need to replace “database_name_here” with the database name which we have just created using phyMyAdmin, replace “username_here” with “root” and leave “password_here” blank.

Instead of using the default database user, you can also optionally, manually create a new user and add to database in phpMyAdmin. See this guide to create database and add user to database in phpMyAdmin. When you run into the database connection not established trouble, this could be the fix.

Complete WordPress installing from browser

Run Safari or any other browser you have on Mac, open this URL http://localhost:8080/wordpress/ to access your local WordPress. You will pull up the classic WordPress setup wizard. Fill up the basic information it requires, click Install WordPress button, your local WordPress on Mac will be created.
Relative Tools:
Another great alternative to XAMPP is MAMP which can also help you create WordPress sites on Mac OS X. Check out this guide: How to Install WordPress on Mac with MAMP?

Migrate Local WordPress to Web Hosting Server

If you have finished testing and experimenting on the WordPress theme, layout, plugins and widgets on a local WordPress blog on Mac, you may want to move it from local machine to a live WordPress hosting server. Here is some very good WordPress hosting service for your information. To migrate a local WordPress, you have to do it all by yourself, your web host may not be able to help as all the files, database and configurations are on your local machine. Check out this guide and see how to transfer WordPress to cPanel hosting.

Update Feb 2019: this article was originally published in Jul 2014 and has since been updated. we update instructions and screenshots above to reflect the changes in the XAMPP for Mac Version 7.3.2 on Mac 10.14 (Mac OS Mojave).

Related