May 4, 2013 11:51 PM
- The -DBIND8COMPAT=1 gets you over a problem in the DNS files because MacOS X has definitions for Bind9 and PHP expects Bind8 definitions.DEAPI is needed if you build it for Apache 1.3.31.O3 enables the gcc optimizer.
- Research And Development Blog Apache Setting up a local web server with PHP on MAC OS X. Setting up a local web server with PHP on MAC OS X. Posted on December 1, 2016, 2:35 pm, by Ilan Hazan, under Apache, Mac OS X, PHP. Mac OS X runs atop UNIX. Apache and PHP come packaged with OS X. To create a local web server, all you need to do is.
MAMP is a Mac utility that helps users install Apache, Nginx, PHP and MySQL on their machine and therefore have a personal web server. The name of the program is an acronym for Macintosh, Apache, MySQL and PHP.
Great guide, thanks John.
Just a note, in case anyone has the same issue. At first I couldn't get this to work. I tried logging out and back in (still no joy), then restarting the mac (still no joy).
Try doing both of those first. However, if, like me, you still can't get the local host site to load, try the following: You should find a file at /Library/WebServer/Documents/index.html.en . This contains the text 'It works!' referred to in the post. What I did was duplicate that file in the same folder and changed the duplicate's name to 'index.html', leaving the original in situ.
Both local and user sites then loaded. After which, I was able to delete the duplicated file and everything now works without issue. Just to be clear, leave the original file index.html.en where it is, untouched and unharmed throughout this step.
Apache Php Server For Mac
Not sure why I had to take this mysterious detour - probably something local to my machine, but if you're having trouble after following the guide above, see if it helps.
Php Install For Mac
May 4, 2013 11:51 PM
<?php
/**
Obtain the MAC address origin of the NIC; currently supports Win/linux system
Get the physical (MAC) address of the machine's network card
**/
Class getmacaddr{
var $result = array (); Returns an array of strings with a MAC address
var $macAddr;
/* Construction */
function __construct ($osType) {
Switch (Strtolower ($osType)) {
Case 'UNIX': break;
Case 'Solaris': Break;
Case 'Aix': a break;
Case 'Linux': {
$this->for_linux_os ();
}break;
Default: {
$this->for_windows_os ();
}break;
}
$temp _array = Array ();
foreach ($this->result as $value) {
if (Preg_match ('/[0-9a-f][0-9a-f][:-]'. ' [0-9a-f] [0-9a-f] [:-]'.' [0-9a-f] [0-9a-f] [:-]'.' [0-9a-f] [0-9a-f] [:-]'.' [0-9a-f] [0-9a-f] [:-]'.' [0-9a-f] [0-9a-f]/i ', $value,
$temp _array)) {
$this->macaddr = $temp _array[0];
Break
}
}
unset ($temp _array);
return $this->macaddr;
}
The method of obtaining in/*linux system * *
function For_linux_os () {
@exec ('Ifconfig-a', $this->result);
return $this->result;
}
The method of obtaining in/*win system * *
function For_windows_os () {
@exec ('Ipconfig/all', $this->result);
if ($this->result) {
return $this->result;
} else {
$ipconfig = $_server['windir']. ' system32ipconfig.exe ';
if (Is_file ($ipconfig)) {
@exec ($ipconfig. '/all', $this->result);
} else {
@exec ($_server['windir']. ' systemipconfig.exe/all ', $this->result);
return $this->result;
}
}
}
}
?>