Now search loadmodule by pressing anycodings_php control+w.įind file named #LoadModule php7_module anycodings_php libexec/apache2/libphp7.so Press command+spacebar, anycodings_php type terminal and press enter.Įnter command $ sudo nano anycodings_php /etc/apache2/nf to edit anycodings_php nf file in nano, which is an anycodings_php inbuilt file editor in macOS.
0 T18:59:47+00:00 T18:59:47+00:00 Answer Linkįor the latest version of mac os i.e anycodings_php Mojave 10.14, follow the steps below to anycodings_php activate PHP server: Then exit and save by pressing ctrl+x anycodings_php (and confirm with "y") Scroll to where it says "# This should anycodings_php be changed to whatever you set anycodings_php DocumentRoot to." and change the next anycodings_php line to: (where "yourusername" is the anycodings_php username you login with) Scroll down to "DocumentRoot" and change anycodings_php it to: (where "yourusername" is the anycodings_php username you login with) DocumentRoot "/Users/yourusername/Sites/" Since I find it useful to have my local anycodings_php sites in my user dir, I created a anycodings_php directory /Users/yourusername/Sites anycodings_php (which isn't there on default anymore in anycodings_php Mountain Lion).Īgain, edit nf via "sudo nano anycodings_php /etc/apache2/nf" and. My phpinfo() returned with a PHP anycodings_php Version 5.3.15 Then restart apache: sudo apachectl restart On default apache only looks for anycodings_php index.html, so search for anycodings_php "DirectoryIndex index.html" and change anycodings_php that to: (adding index.html at the end anycodings_php is optional of course) DirectoryIndex index.php index.html index.htmĮxit and save by pressing ctrl+x (and anycodings_php confirm with "y") You can leave the group as-is, "Group anycodings_php _www" by default on a fresh OS X anycodings_php Mountain Lion install. To make sure you can include files etc anycodings_php in PHP, scroll to "User _www" (in my anycodings_php case) and change that to: (where anycodings_php "yourusername" is the user you login anycodings_php with) User yourusername Then uncomment this line by removing the anycodings_php '#' in front of it (ctrl+v can be used anycodings_php as page-down) LoadModule php5_module libexec/apache2/libphp5.so Like Matt Gibson said, start terminal anycodings_php and type: (sudo requires your root anycodings_php password) sudo nano /etc/apache2/nf Took me a couple of tries to get it anycodings_php working, so here is basically what did anycodings_php it for me and hopefully it'll help you anycodings_php guys save a little time.
I don't see why anycodings_php anyone would use MAMP or AMPPS (or any anycodings_php other packed 3rd party out-of-box anycodings_php webserver app) when Mac OS X comes with anycodings_php apache and PHP by default. I too like to use things that are anycodings_php basically already there.
If anycodings_php you run OSX 10.12 or newer, please anycodings_php follow this more than excellent guide by anycodings_php Andy Miller: macOS 10.15 Catalina Apache anycodings_php Setup: Multiple PHP Versions UPDATE: Please note that this was anycodings_php written for OS X pre-(High) Sierra.