{"id":19385,"date":"2014-02-24T18:01:01","date_gmt":"2014-02-24T10:01:01","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=19385"},"modified":"2024-07-29T23:56:51","modified_gmt":"2024-07-29T15:56:51","slug":"osx-apache-mysql-php-part-1","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/","title":{"rendered":"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP"},"content":{"rendered":"<p>Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the <strong>Applications<\/strong> folder, launch the app, and click the <span class=\"key\">Start Server<\/span> button. It\u2019s that simple.<\/p>\n<p>However, macOS already comes with PHP and Apache built-in, so why not use them to develop and <strong>run websites <em>locally<\/em><\/strong> instead of relying on third-party apps like MAMP? This approach not only saves space but also gives you the opportunity to learn more about the setup process.<\/p>\n<p>In this post, we will guide you on how to configure <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.php.net\/\">PHP<\/a>, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.apache.org\/\">Apache<\/a>, and <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.mysql.com\/\">MySQL<\/a> on macOS without MAMP.<\/p>\n<div class=\"ref-block ref-block--post\" id=\"ref-post-1\">\n\t\t\t\t\t<a href=\"https:\/\/www.hongkiat.com\/blog\/wordpress-multisite-with-mamp\/\" class=\"ref-block__link\" title=\"Read More: Beginner\u2019s Guide to WordPress Multisite with MAMP\" rel=\"bookmark\"><span class=\"screen-reader-text\">Beginner\u2019s Guide to WordPress Multisite with MAMP<\/span><\/a>\n<div class=\"ref-block__thumbnail img-thumb img-thumb--jumbo\" data-img='{ \"src\" : \"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/wordpress-multisite-with-mamp.jpg\" }'>\n\t\t\t\t\t\t\t<noscript>\n<style>.no-js #ref-block-post-17924 .ref-block__thumbnail { background-image: url(\"https:\/\/assets.hongkiat.com\/uploads\/thumbs\/250x160\/wordpress-multisite-with-mamp.jpg\"); }<\/style>\n<\/noscript>\n\t\t\t\t\t\t<\/div>\n<div class=\"ref-block__summary\">\n<h4 class=\"ref-title\">Beginner\u2019s Guide to WordPress Multisite with MAMP<\/h4>\n<p class=\"ref-description\">\n\t\t\t\t\t\tAccording to BuiltWith.com, WordPress is the most popular publishing platform with more than 8 million website using it...\t\t\t\t\t\t<span>Read more<\/span><\/p>\n<\/div>\n<\/div>\n<h2>Step 1: Enable Sublime Text Command Line<\/h2>\n<p>First, since I\u2019m using Sublime Text, I want to enable the Sublime Text command line so I can open files and folders through Terminal and edit them within Sublime Text. Here\u2019s how to do it:<\/p>\n<p><strong>1.<\/strong> Create a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/hints.macworld.com\/article.php?story=2001110610290643\">symlink<\/a> of the Sublime Text <code>subl<\/code> binary in the ~\/bin folder with this command:<\/p>\n<pre>\r\n ln -s \"\/Applications\/Sublime Text.app\/Contents\/SharedSupport\/bin\/subl\" ~\/bin\/subl\r\n<\/pre>\n<p><strong>2.<\/strong> Then, run the <code>subl --help<\/code> command.<\/p>\n<p>This will return the <strong>Usage and the list of Arguments<\/strong> that can be used with <code>subl<\/code>, as shown in the screenshot below. Additionally, this confirms that <code>subl<\/code> is registered and working.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/subl-command-line.jpg\" width=\"500\" height=\"150\" alt=\"Sublime Text Command Line Usage\"><\/figure>\n<h2>Step 2: Configure PHP<\/h2>\n<p>As mentioned, PHP is already installed on macOS. You can check the installed PHP version in <strong>Terminal<\/strong> with the following command:<\/p>\n<pre>\r\n php -v\r\n<\/pre>\n<h3>Enable PHP<\/h3>\n<p>However, the PHP module is disabled by default. We need to enable it to use and execute PHP scripts on the Apache server:<\/p>\n<p><strong>1.<\/strong> Type the following command to open <strong>httpd.conf<\/strong> in Sublime Text.<\/p>\n<pre>\r\n sudo subl \/etc\/apache2\/httpd.conf\r\n<\/pre>\n<p><strong>2.<\/strong> Uncomment the following line by removing the hash sign <code>#<\/code>:<\/p>\n<pre>\r\n LoadModule php5_module libexec\/apache2\/libphp5.so\r\n<\/pre>\n<p>See the screenshot below for more detail:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/load-php.jpg\" width=\"500\" height=\"180\" alt=\"Uncomment PHP Module Line\"><\/figure>\n<h3>Enable PHP.ini<\/h3>\n<p>PHP configurations such as <strong>Increasing Memory Limit<\/strong>, <strong>File Upload Allowance<\/strong>, and <strong>Setting the Maximum Upload File Size<\/strong> are done through the <strong>php.ini<\/strong> file, which is also disabled by default. Let\u2019s enable it.<\/p>\n<p>Go to Terminal and run the following command. This command copies the <strong>php.ini.default<\/strong> and renames it to <strong>php.ini<\/strong>:<\/p>\n<pre>\r\n sudo cp \/private\/etc\/php.ini.default \/private\/etc\/php.ini\r\n<\/pre>\n<h2>Step 3: Configure Apache<\/h2>\n<p>macOS also comes with Apache. You can type the following command in Terminal to start the Apache server:<\/p>\n<pre>\r\n sudo apachectl start\r\n<\/pre>\n<p>To stop Apache, type:<\/p>\n<pre>\r\n sudo apachectl stop\r\n<\/pre>\n<p>Access <code>http:\/\/localhost:8888<\/code> in your browser to verify that the Apache server is working. If it is, you should see a message saying <strong>\u201cIt Works!\u201d<\/strong><\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/it-works.jpg\" width=\"500\" height=\"150\" alt=\"Apache It Works Message\"><\/figure>\n<h3>Change DocumentRoot<\/h3>\n<p>The default Apache DocumentRoot, where you should put your website documents, is located at \/Library\/WebServer\/Documents. However, if all your existing web projects reside in \/Users\/username\/Sites, let\u2019s change the DocumentRoot to that folder:<\/p>\n<p><strong>1.<\/strong> Run the following command lines consecutively to create a user-level configuration file. Replace <code>username<\/code> with your macOS shortname account:<\/p>\n<pre>\r\n cd \/etc\/apache2\/users\/\r\n touch username.conf\r\n<\/pre>\n<p><strong>2.<\/strong> Open this file in Sublime Text:<\/p>\n<pre>\r\n sudo subl username.conf\r\n<\/pre>\n<p><strong>3.<\/strong> Then, add the following lines:<\/p>\n<pre>\r\n DocumentRoot \"\/Users\/username\/Sites\"\r\n &lt;Directory \"\/Users\/username\/Sites\"&gt;\r\n Options All\r\n AllowOverride All\r\n Order allow,deny\r\n Allow from all\r\n &lt;\/Directory&gt;\r\n<\/pre>\n<h3>Change Apache Port Number<\/h3>\n<p>By default, Apache runs on port 80. But since I was using MAMP, which uses port <code>8888<\/code>, I\u2019m making Apache use this port number instead. This way, I won\u2019t need to change the site URLs for all my existing websites.<\/p>\n<p><strong>1.<\/strong> Open <strong>httpd.conf<\/strong> and comment out the following line by adding a hash sign so it won\u2019t listen to two ports simultaneously:<\/p>\n<pre>\r\n #Listen 80\r\n<\/pre>\n<p><strong>2.<\/strong> Then open <strong>username.conf<\/strong> and add:<\/p>\n<pre>\r\n Listen 8888\r\n ServerName localhost:8888\r\n<\/pre>\n<p><strong>3.<\/strong> After making all the above configurations, save <strong>httpd.conf<\/strong> and <strong>username.conf<\/strong>, and type the following command to restart Apache:<\/p>\n<pre>\r\n sudo apachectl restart\r\n<\/pre>\n<p><strong>4.<\/strong> Finally, access <code>http:\/\/localhost:8888<\/code> in your browser. It will display all the directories stored within the ~\/Sites folder, as shown below:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/index-of.jpg\" width=\"500\" height=\"320\" alt=\"Index of Sites Folder\"><\/figure>\n<h3>Run Apache at Startup<\/h3>\n<p>You might not want to launch Terminal and type <code>sudo apachectl start<\/code> repeatedly to start the Apache server. To make it run automatically at startup, run the following command:<\/p>\n<pre>\r\n sudo launchctl load -w \/System\/Library\/LaunchDaemons\/org.apache.httpd.plist\r\n<\/pre>\n<h2>Wrap Up<\/h2>\n<p>In this tutorial, we have configured PHP and Apache. Technically, we can now run a PHP website. You can test it by creating a PHP file named <strong>phpinfo.php<\/strong> in ~\/Sites and adding the following code:<\/p>\n<pre>\r\n&lt;?php phpinfo(); ?&gt;\r\n<\/pre>\n<p>Then, launch the file in your browser by navigating to <code>http:\/\/localhost:8888\/phpinfo.php<\/code>. It will display the current PHP configuration details.<\/p>\n<p>In the next part of this series, we will show you how to install MySQL and make everything work together seamlessly. So, stay tuned.<\/p>","protected":false},"excerpt":{"rendered":"<p>Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the Applications folder, launch the app, and click the Start Server button. It\u2019s that simple. However, macOS already comes with PHP and Apache built-in, so why not use them to develop&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3400],"tags":[2987,4656,3933,254,1319],"topic":[4521],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP - Hongkiat<\/title>\n<meta name=\"description\" content=\"Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the Applications folder,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP\" \/>\n<meta property=\"og:description\" content=\"Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the Applications folder,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2014-02-24T10:01:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-29T15:56:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/subl-command-line.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP\",\"datePublished\":\"2014-02-24T10:01:01+00:00\",\"dateModified\":\"2024-07-29T15:56:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/\"},\"wordCount\":679,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/osx-apache-mysql-php-part-1\\\/subl-command-line.jpg\",\"keywords\":[\"Apache\",\"Localhost and Webserver\",\"macOS\",\"MySQL\",\"PHP\"],\"articleSection\":[\"Hosting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/\",\"name\":\"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/osx-apache-mysql-php-part-1\\\/subl-command-line.jpg\",\"datePublished\":\"2014-02-24T10:01:01+00:00\",\"dateModified\":\"2024-07-29T15:56:51+00:00\",\"description\":\"Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the Applications folder,\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/osx-apache-mysql-php-part-1\\\/subl-command-line.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/osx-apache-mysql-php-part-1\\\/subl-command-line.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/osx-apache-mysql-php-part-1\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP - Hongkiat","description":"Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the Applications folder,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/","og_locale":"en_US","og_type":"article","og_title":"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP","og_description":"Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the Applications folder,","og_url":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2014-02-24T10:01:01+00:00","article_modified_time":"2024-07-29T15:56:51+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/subl-command-line.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP","datePublished":"2014-02-24T10:01:01+00:00","dateModified":"2024-07-29T15:56:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/"},"wordCount":679,"commentCount":4,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/subl-command-line.jpg","keywords":["Apache","Localhost and Webserver","macOS","MySQL","PHP"],"articleSection":["Hosting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/","url":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/","name":"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/subl-command-line.jpg","datePublished":"2014-02-24T10:01:01+00:00","dateModified":"2024-07-29T15:56:51+00:00","description":"Using MAMP is probably the easiest way to get PHP, Apache, and MySQL up and running on macOS. You simply place the application in the Applications folder,","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/subl-command-line.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/osx-apache-mysql-php-part-1\/subl-command-line.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/osx-apache-mysql-php-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install PHP, Apache, and MySQL on a Mac Without Using MAMP"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-52F","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=19385"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19385\/revisions"}],"predecessor-version":[{"id":72408,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/19385\/revisions\/72408"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=19385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=19385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=19385"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=19385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}