Best Apache Php Mysql Package For Mac

Best Apache Php Mysql Package For Mac Average ratng: 4,3/5 8515 votes

Dec 11, 2013  - First compile/install apache, see compileapache.sh for more info - Then compile/install php/mysql, see compilephp.sh for more info - Tested on Mac OSX 10.8, 2013.01.15. A brief demo of containerizing php apache and mysql with Docker using some best practices. mzazon/php-apache-mysql-containerized. And self-heal on Docker Swarm or even Kubernetes on the latest Docker for Mac or Docker Enterprise Edition!

In this tutorial we will learn to install Apache, MySQL, PHP on macOS Catalina 10.15.

About macOS Catalina

Apple released macOS Catalina 10.15 on 7th October 2019 and it includes Apache and PHP. So, all we have to do is enable them. Then install MySQL and we are ready for development. So, lets get started.

Note! Support for 32 bit apps is removed in Catalina so, all your 32 bit applications will no longer work. Kindly upgrade your applications.

Apple has also made zsh as the default shell. You can learn more about it here.

To change the default shell check the tutorial How to change default shell to bash on macOS Catalina.

We will be using the pre-installed Apache and PHP and we will download and setup MySQL database.

If you are using macOS Mojave then check out this tutorial How to install Apache, MySQL, PHP on macOS Mojave 10.14

Lets go ahead and configure our LAMP stack development environment on macOS Catalina.

Apache

The new macOS Catalina comes with Apache pre-installed. All we have to do is switch it on.

Open Terminal using macOS Spotlight or go to /Applications/Utilities and open Terminal.

To check the version of Apache installed run the following command in the Terminal.

Note! macOS Catalina comes with Apache 2.4.41

To start Apache web server run the following command.

This command will start Apache server.

When you use sudo in the terminal then you will be prompted to enter your admin password to proceed.

If you want to stop the Apache server then run the following command.

And to restart Apache server run the following command.

After starting Apache server go ahead and test it by opening a browser like Safari or Chrome and visit http://localhost.

You will get to see the following output in your browser.


By default, the file is getting served from /Library/WebServer/Documents directory. We will change this is the following sections.

In case you don't get to see the above output then run the following command to check the error.

Document Root

This is the location in the computer file system from where the files are accessed when we visit the http://localhost in a browser.

Document Root is a directory where we put our website files.

On Mac we have two document root. One is at the system level and the other is at the user level.

System level document root

The system level document root in macOS Catalina is located in the following directory.

User level document root

For the user level we can create a directory called Sites in user directory. So, open Terminal and get ready to create the user level document root directory.

Creating Sites directory

Run the following command in the Terminal to switch to the user home directory.

Now, run the following command to create the Sites directory.

You can merge the above two commands into one by running the following command.

For me the user document root path is the following.

You will get a similar path for your Mac.

Creating username.conf file

Now, we will create a username.conf file to configure our document root.

Note! Replace the username with your username.

For example, my username is yusufshakeel so, my file is yusufshakeel.conf.

Type the whoami command in the terminal and it will tell you your username.

Open terminal and go to the following directory.

Now create the configuration file username.conf inside the users directory.

In the following example I am using vi editor. You can use other editors like vim or nano.

Press the i key to enter into INSERT mode and then type the following in the file.

Don't forget to replace YOUR_USER_NAME with your username.

Here is what I have written in my yusufshakeel.conf file.


Now, come out of the INSERT mode by pressing the Esc key. Now save the file and exit by typing the following :wq and then hit Enter.

The permission of this file should be the following.

You can change the permission by typing the following command.

Where, username is your username that you have set.

Configuring the httpd.conf file

Now we switch to apache2 directory by typing the following command in the Terminal.

Inside this directory we have the httpd.conf file.

As a good practice we will make a backup copy of the httpd.conf file by typing the following command.

Now open the httpd.conf file using vi and uncomment the following lines.

To uncomment the lines remove the # from the start of the line.

Uncomment the following line for User home directories.

Now change the DocumentRoot.

Find the following lines and comment them by adding # at the beginning of the line.

And add the following two lines below the commented lines.

Don't forget to replace YOUR_USERNAME with your username.


And set the AllowOverride None to AllowOverride All.

Your DocumentRoot should now look something like the following.

Now, come out of the INSERT mode by pressing the Esc key. And save and exit the file by typing :wq key and then Enter.

Configuring the httpd-userdir.conf file

Now, time to make some changes in the httpd-userdir.conf file.

In the terminal type the following command to go to the extra directory.

As a good practice create a backup copy of the httpd-userdir.conf file.

Now open the file using vi.

Enter into INSERT mode and uncomment the following line.

Now, come out of the INSERT mode and save the changes.

Now, check if everything is configured properly by typing the given command.

Now restart Apache using the following command.

PHP

macOS Catalina comes with PHP 7.3.8 pre-installed.

To check the version of PHP in the Terminal type the following command.

Now we go to the apache2 directory.

Next, we open the httpd.conf file.

Now, enter into INSERT mode and uncomment the following line to run PHP 7 by removing the # sign from the start of the line.

Now, save the changes and exit the file by typing :wq keys and hit Enter.

You can now restart Apache by running the following command.

Printing phpinfo

Create index.php file inside the Sites directory.

Now open the file in your favourite text editor or PHP IDE and write the following code.

Now, visit http://localhost and you will get to see a similar output.


Download MySQL community server

Head over to mysql.com website and download the latest version of the MySQL Community Server.


Download and run the installer and follow the steps to install MySQL database on your Mac.

Set the root password when prompted and note it down.

To run MySQL server open System Preferences and go to MySQL.


Click on the Start MySQL Server button to start the server.


You will be asked to enter your admin password. Enter the password and the MySQL server will start running.

Extra

To access your MySQL database tables you can either use phpMyAdmin, MySQL Workbench or Sequel Pro.

Alright, this brings us to the end of this tutorial. Hope this helped. Please share if you find this website useful. Have fun developing. See you in the next tutorial.

17 Best Alternatives of Xampp Server:- Xampp is an open source application that is primarily used for testing. Programmers can develop a local web server using Xampp. Xampp is equally compatible with operating systems like Linux, Microsoft Windows and Mac as well.
Programmers find Xampp very easy to use, the reason is simple that it is powered by Apache, MySQL, PHP and Perl. So if user were to develop local web server, Xampp would pretty much take care of things like server application, a database management system, coding language and network programming.
Are there any alternatives to Xampp? Yes, there are. We will look at these different alternatives.

WampServer

WampServer is also another tool used for creating web applications and PHP development. WampServer will come along with three major tools like PHP, MySQL and Apache. WampServer is only available for Microsoft Windows OS.
One advantage that WampServer provides is the interface that is available in many languages. You have the ability to see all the elements on the browser. Another function worth mentioning is that that the PhpMyAdmin would take care of the database management. You can also try offline and online modes with WampServer.
If the accessibility concerns you, then you can limit it to local-host, otherwise, you can choose everyone to get the access. You can have access to server settings and files as well. Another interesting feature that WampServer offers is that you can accommodate all the next versions of PHP, Apache and MySQL into it. So, you can keep on upgrading with new releases as you move ahead.

EasyPHP

EasyPHP is one of the best contenders to Xampp. If you want to only focus on the coding part, and leave the rest headache of configuration, then this is the best tool. It will get you PHP, the scripting language along with MySQL for database management. Apache will take care of web server application.
Even if you are a beginner with coding, you can use EasyPHP as a tool for development. You can work with applications like WordPress, Joomla and Drupal with EasyPHP. But remember, you cannot host websites using EasyPHP. If you want to turn your machine into personal hosting, then go for EasyPHP WebServer. This will enable offline hosting in the machine that will be easy to operate, and also will be secured. If you otherwise want a WAMP environment for your machine, then go for EasyPHP DevServer. These versions will have difference in programs offered, apart from the basic ones.

UwAmp Server


UwAmp Server is another development tool for web applications of Microsoft Windows OS. UwAmp Server has tools like SQLite, Apache and PHP integrated with it. With UwAmp Server, if user decided to have web applications tested offline, then that would be possible. So you wouldn’t actually need an internet connection to get the applications tested. Users who are concerned about the installation of UwAmp Server need not worry because it doesn’t need an installation. You can very well begin with a zipped file.
Users are bound to find the interface for UwAmp Server very interactive. Users will be able to find a lot of information with the interface. You can check configuration settings along with the commands on the interface. If you are to run a new PHP releases along with UwAmp Server, then that would be feasible. Users will also be able to get data on the CPU usage. Users can even run the web server from the flash disk using UwAmp Server.

AMPPS

Users can use AMPPS to develop web applications in PHP. AMPPS (from Softaculous) can be run on Microsoft Windows, Mac and Linux OS. The availability of AMPPS on operating systems other Microsoft Windows gives it a strong position amongst the top. The installation is too easy and the user can begin within minutes after the installation.
With AMPPS, you will find integrated tools like Apache, MySQL, Python, MongoDB and Perl. It is certainly one major tool for PHP. Users can get an access to over 300 PHP web applications along with thousands of classes of PHP. All the editions of PHP are compatible with AMPPS.
Users can do the website development either by programming themselves or by open-source web apps. With a single mouse click, users will be able to manage the database. The scripting part with AMPPS has been made easy for users. You can work on any application that suits your requirement like WordPress, Joomla or Drupal.

The Uniform Server

The Uniform Server also stands in the top category of tools used to run web servers, mainly used to check and validate HTML coding. The Uniform Server can only be run on Microsoft Windows OS. The Uniform Server comes with Apache, PHP, Perl and MySQL. All the latest versions are compatible with The Uniform Server.
Features that most of the users like about The Uniform Server are that that it doesn’t require to be installed, and the fact that it will consume less than 10MB storage space. This is really great for users who have to go through the cumbersome set-up process, and also that consumes a lot of space. Users can get updates on a regular basis, along with some great support to resolve queries on time. Users can also go one step further and change the settings to get better control over programming. So if you are looking for extra configuration and tweaking, then The Uniform Server is one of the best options.

MAMP

MAMP is tool to run websites that are more complex in nature, like Dynamic Websites. MAMP happened to be serving only Mac Operating System earlier. As it is made for Macintosh, it is called as MAMP. So if you came across the term LAMP, then it is a similar version to MAMP, but used for Linux OS. You can even find a similar version for Microsoft Windows.
MAMP is a great tool that comes along with a database management system, Web server and countless programming languages. So by now you would have guessed that it has Apache, MySQL, Perl, Python and PHP support.
MAMP is open-source. Users like to use MAMP with applications like Drupal and other Content Management System apps. Users even like MAMP for the fact that it does not tamper with other existing applications in the system. They don’t even make any alterations in configuration.
On deleting MAMP, users will be surprised to know that system remains normal like before. MAMP has also got a pro version to offer. You will usually need this if you are a professional programmer, and would want to get additional features for multiple hosting along with features like virtual server, Dynamic DNS, Multi-PHP and LAN Access.

WPN-XM

WPN-XM is also an amazing tool to build PHP web applications. WPN-XM is only available for Microsoft Windows OS. If users want to try a different stack than those available with other software, then WPN-XM is an ideal choice. WPN-XM is the package that consists of MariaDB for database management, NGINX for the web server and PHP for coding. X stands for Xdebug, which is a debugger. So initials of all these softwares make WPN-XM.
The interface will make the running of server very easy for the users. Users can even get a lot of utils like Composer, Pickle, PHPUnit for development. You can even add many types of software with WPN-XM if you need to. Users can get the list of updates from the register available.
Users may not worry about installation related problems, as WPN-XM comes with 5 installation wizards. So what all wizards can a user expect from WPN-XM? You will get hands on The Webinstaller, The Full Installer, The standard Installer, The LiteRC Installer and The Lite Installer.

For HP products a product number. Use product model name: - Examples: laserjet pro p1102, DeskJet 2130. Hp laserjet 4250 pcl 6 drivers for mac.

Wnmp

Wnmp is a tool used for development environment. Wnmp offers a great interface that is easy to operate, yet a robust one. It is an open-source platform that comes along with MariaDB, PHP, NGINX and a Control Panel.
Users find Wnmp very easy to operate, the only part users may find irritating is the installation, as it may go on for longer than usual time. User can easily configure the settings for the tools that are available along with Wnmp. User can perform set of actions like reloading and running of settings. The editor available with Wnmp is Notepad. But the user has control to change that. User can also increase the speed by changing few settings. If you want to see the program activity, you can go to the bottom of the interface and check.
Generally, users like Wnmp because it doesn’t consume much of the RAM, therefore the system performance wouldn’t get tampered with Wnmp. Booting with Wnmp is also easy and smooth experience for users.

SecureWamp

The difference between Wamp and SecureWamp is that the latter is more secure to be used. Needless to mention, other tools like MySQL, Windows, Apache and PHP are made available to the users.
Users have two options for settings with SecureWamp, that is either they can opt for developers or for production settings. For secure web hosting, users would always prefer to work with SecureWamp. There is a central Graphical User Interface available to take control of settings, meaning that all the pain of configuration files that are cryptic is taken care of. User need not even worry of problems like number of interfaces.
If you happen to be a web developer or an administrator, then SecureWamp might serve you well for testing and development.

DesktopServer

DesktopServer is best-known software that is used along with WordPress for development and testing. It can be seen as a strong competitor to Xampp. DesktopServer can skip all the redundant tasks for you. Users rarely have to be worried about database management and file configuration.
DesktopServer is friendly software and you will be happy to realize that the time taken is way too low as compared to some other similar software. Website development for all the WordPress users has become unimaginably simple with DesktopServer. Users have to just click a few times, and they can see the new website.
Do not worry about the WordPress files, DesktopServer will get all the necessary files installed for you. You don’t even have to worry about security keys. The interface is quite simple, so if you are new, it wouldn’t matter much. You can even export, import and share files. And if you are a seasoned player, then you will be happy to use a powerful software as DesktopServer.
For all WordPress admirers, it cannot just get better if you have DesktopServer with you. There are some advanced features for software available with a premium version of the same software. You can use the software for Microsoft Windows and Mac OS.

Abyss Web Server

For Microsoft Windows, Mac and Linux OS users, Abyss Web Server is another tool available as a web server, as the name suggests. Abyss Web Server complies with all the norms of HTTP/1.1.
People using Abyss Web Server can tell that it consumes fewer resources in comparison to other tools, it consumes less memory, and hence the load on the system by Abyss Web Server is very low. And despite of the fact that it consumes very less resources, it doesn’t compromise with the speed. The interface comes with a support for many languages. Users can also find a feature that is designed to be an anti-hacking function, and this is automatic.
Users can even go at lengths with customization to suit their needs. It is also portable. These features make the browsing experience very easy for the user. There are two versions available, the basic version if free. However, if you want it for professional use, then you can buy the Pro Version.

USB Webserver

As the name suggests, USB Webserver can be run without even being installed on the machine, you can simply run it from the USB. You can build PHP websites with the software. With USB Webserver, the user will get access to PHP, phpMyAdmin, Apache and Mini Relay. As it runs from the USB, you don’t have to worry about any files and logs left on your system.
It is free software and users find it very easy to be used. Professionals will also find it quite flexible. Users can find multi-lingual support with the new versions of the USB Webserver. The earlier version had a DPI bug, the current version has got that bug fixed.
Generally, users prefer to use USB Webserver to demonstrate the offline version of the website. Users even have the ability to work from various locations, and also run the test before making the website live. It’s also free and open-source. Looking at the amount of resources that it consumes, it is very responsive. Users will have a nice experience with its interface.

Denwer

Denwer is usually used for debugging and developing the websites. Denwer will get a list of web-servers along with it. It will contain stack of PHP, Perl, MySQL, Apache, phpMyAdmin and a Virtual host management system.
You will get all of these pre-configured when you install, but users can manage to customize according to their requirements. Once you install, all you need to do is PHP coding. Users can start developing and debugging along with it. Users can also manage to debug the website offline. You can easily work with installation and configurations smoothly, but you may struggle with the language, as it is Russian.

FoxServ

FoxServ is software used for development on OS such as Microsoft Windows and Linux. FoxServ gets PHP installer, MySQL and Apache along with it in the package. User can avail the new releases for all these applications along with the configuration.

PHPTriad

PHPTriad is a good tool for PHP development. PHPTriad is also used as a server environment for Microsoft Windows OS. User can avail PHP, MySQL, Apache and phpMyAdmin with PHPTriad.
Users find it very simple to handle. The installations are also quite simplified. Users will also find the compiling process very easy. So they can expect a pretty decent environment, database management and web server with PHPTriad. The settings with this software have kept quite basic, so if you need some other settings, then you can configure according to your needs. If you need PHP and Perl libraries, then you may need to get those externally as those are not pre-installed.

Winginx

Winginx is a local web server used by developers. Most often it is used by Nginx users. Although users of PHP, MongoDB , MySQL and NodeJS can also use it. Winginx is not easy as other software to be used. It is used along with Microsoft Windows OS. But, users need to be wary of the fact that it cannot be used with all the versions of Windows. They can only use it along with versions that are higher than Vista or Vista itself.
The installation is easy, you don’t have to struggle much with this part. Users can develop multiple projects with Winginx. The platform is very accommodative for local web development. Users can perform tasks like testing and launching of the local websites. Same is true for services and applications that are browser-based. Users like Winginx for the fact that settings can be easily changed, and the updates for its components can be obtained on a regular basis.

Saurav is associated with IT industry and computers for more than a decade and is writing on The Geek Page on topics revolving on windows 10 and softwares.

Recommended for You: