[{"data":1,"prerenderedAt":1333},["ShallowReactive",2],{"article-20141020-osx-yosemite-php-mysql":3},{"article":4,"surround":1322},{"id":5,"title":6,"authorKey":7,"body":8,"codeLinks":1302,"createdAt":1303,"description":1304,"excerpt":1305,"extension":1312,"image":1313,"meta":1314,"navigation":948,"path":1315,"published":1316,"readingTime":422,"revisedAt":1302,"seo":1317,"stem":1318,"tags":1319,"__hash__":1321},"articles\u002Farticles\u002F20141020-osx-yosemite-php-mysql.md","Setting up PHP & MySQL on OS X Yosemite","philip",{"type":9,"value":10,"toc":1295},"minimark",[11,23,27,33,72,86,93,122,125,148,151,175,182,185,202,213,217,224,235,287,290,328,331,369,376,428,435,439,456,468,531,534,549,553,566,583,586,597,616,619,622,693,704,708,714,762,765,792,798,816,924,930,982,988,1144,1147,1188,1194,1202,1207,1222,1225,1246,1249,1274,1277,1291],[12,13,14,15,22],"p",{},"How to set up a dev environment on OS X Yosemite (10.10) with ",[16,17,21],"a",{"href":18,"rel":19},"https:\u002F\u002Fbrew.sh\u002F",[20],"nofollow","Homebrew",", PHP, MySQL, and Apache.",[24,25,21],"h2",{"id":26},"homebrew",[12,28,29,32],{},[16,30,21],{"href":18,"rel":31},[20]," is a package manager for OS X. Install it, as we'll need it later:",[34,35,40],"pre",{"className":36,"code":37,"language":38,"meta":39,"style":39},"language-bash shiki shiki-themes github-light-default github-light-default github-dark-default","$ \u002Fbin\u002Fbash -c \"$(curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002FHomebrew\u002Finstall\u002FHEAD\u002Finstall.sh)\"\n","bash","",[41,42,43],"code",{"__ignoreMap":39},[44,45,48,52,56,60,63,66,69],"span",{"class":46,"line":47},"line",1,[44,49,51],{"class":50},"sQJ0q","$",[44,53,55],{"class":54},"s-BGO"," \u002Fbin\u002Fbash",[44,57,59],{"class":58},"sDkKp"," -c",[44,61,62],{"class":54}," \"$(",[44,64,65],{"class":50},"curl",[44,67,68],{"class":58}," -fsSL",[44,70,71],{"class":54}," https:\u002F\u002Fraw.githubusercontent.com\u002FHomebrew\u002Finstall\u002FHEAD\u002Finstall.sh)\"\n",[12,73,74,75,79,80,85],{},"You'll also need the ",[76,77,78],"strong",{},"Xcode command line tools"," – at least version 6.1. Xcode is available on the ",[16,81,84],{"href":82,"rel":83},"https:\u002F\u002Fdeveloper.apple.com\u002Fxcode\u002Fdownloads\u002F",[20],"Mac App Store"," as a free download. Don't forget to start up Xcode at least once after initial installation.",[12,87,88,89,92],{},"Initially and after every major OS X upgrade, you might need to reinstall the Xcode command line tools and ",[76,90,91],{},"accept the license aggreement",":",[34,94,96],{"className":36,"code":95,"language":38,"meta":39,"style":39},"$ xcode-select --install\n$ sudo xcodebuild -license\n",[41,97,98,108],{"__ignoreMap":39},[44,99,100,102,105],{"class":46,"line":47},[44,101,51],{"class":50},[44,103,104],{"class":54}," xcode-select",[44,106,107],{"class":58}," --install\n",[44,109,111,113,116,119],{"class":46,"line":110},2,[44,112,51],{"class":50},[44,114,115],{"class":54}," sudo",[44,117,118],{"class":54}," xcodebuild",[44,120,121],{"class":58}," -license\n",[12,123,124],{},"Also, don't forget to create this missing symlink after upgrading to a new major OSX version:",[34,126,128],{"className":36,"code":127,"language":38,"meta":39,"style":39},"$ sudo ln -s \u002FApplications\u002FXcode.app\u002FContents\u002FDeveloper\u002FToolchains\u002FXcodeDefault.xctoolchain \u002FApplications\u002FXcode.app\u002FContents\u002FDeveloper\u002FToolchains\u002FOSX10.10.xctoolchain\n",[41,129,130],{"__ignoreMap":39},[44,131,132,134,136,139,142,145],{"class":46,"line":47},[44,133,51],{"class":50},[44,135,115],{"class":54},[44,137,138],{"class":54}," ln",[44,140,141],{"class":58}," -s",[44,143,144],{"class":54}," \u002FApplications\u002FXcode.app\u002FContents\u002FDeveloper\u002FToolchains\u002FXcodeDefault.xctoolchain",[44,146,147],{"class":54}," \u002FApplications\u002FXcode.app\u002FContents\u002FDeveloper\u002FToolchains\u002FOSX10.10.xctoolchain\n",[12,149,150],{},"Once Homebrew is set up and you want to upgrade outdated packages, run:",[34,152,154],{"className":36,"code":153,"language":38,"meta":39,"style":39},"$ brew update\n$ brew upgrade\n",[41,155,156,166],{"__ignoreMap":39},[44,157,158,160,163],{"class":46,"line":47},[44,159,51],{"class":50},[44,161,162],{"class":54}," brew",[44,164,165],{"class":54}," update\n",[44,167,168,170,172],{"class":46,"line":110},[44,169,51],{"class":50},[44,171,162],{"class":54},[44,173,174],{"class":54}," upgrade\n",[12,176,177,178,181],{},"Remember to also run ",[41,179,180],{},"brew update && brew upgrade"," after upgrading to a new major OS X version.",[12,183,184],{},"List all installed packages:",[34,186,188],{"className":36,"code":187,"language":38,"meta":39,"style":39},"$ brew list --versions\n",[41,189,190],{"__ignoreMap":39},[44,191,192,194,196,199],{"class":46,"line":47},[44,193,51],{"class":50},[44,195,162],{"class":54},[44,197,198],{"class":54}," list",[44,200,201],{"class":58}," --versions\n",[12,203,204,205,208,209,212],{},"You should never be required to run ",[41,206,207],{},"brew"," as root using ",[41,210,211],{},"sudo","!",[24,214,216],{"id":215},"php","PHP",[12,218,219,220,223],{},"Apple ships PHP 5.5.14 with OS X Yosemite but we're not going to use it and install the ",[76,221,222],{},"latest PHP 5.6"," instead via Homebrew.",[12,225,226,227,230,231,234],{},"Tap ",[41,228,229],{},"homebrew\u002Fhomebrew-php"," and all its dependencies (",[41,232,233],{},"homebrew\u002Fhomebrew-binary"," actually is no dependency but we might need it for binary PHP extensions):",[34,236,238],{"className":36,"code":237,"language":38,"meta":39,"style":39},"$ brew tap homebrew\u002Fdupes\n$ brew tap homebrew\u002Fversions\n$ brew tap homebrew\u002Fhomebrew-php\n$ brew tap homebrew\u002Fhomebrew-binary\n",[41,239,240,252,263,275],{"__ignoreMap":39},[44,241,242,244,246,249],{"class":46,"line":47},[44,243,51],{"class":50},[44,245,162],{"class":54},[44,247,248],{"class":54}," tap",[44,250,251],{"class":54}," homebrew\u002Fdupes\n",[44,253,254,256,258,260],{"class":46,"line":110},[44,255,51],{"class":50},[44,257,162],{"class":54},[44,259,248],{"class":54},[44,261,262],{"class":54}," homebrew\u002Fversions\n",[44,264,266,268,270,272],{"class":46,"line":265},3,[44,267,51],{"class":50},[44,269,162],{"class":54},[44,271,248],{"class":54},[44,273,274],{"class":54}," homebrew\u002Fhomebrew-php\n",[44,276,278,280,282,284],{"class":46,"line":277},4,[44,279,51],{"class":50},[44,281,162],{"class":54},[44,283,248],{"class":54},[44,285,286],{"class":54}," homebrew\u002Fhomebrew-binary\n",[12,288,289],{},"Install PHP 5.6:",[34,291,293],{"className":36,"code":292,"language":38,"meta":39,"style":39},"$ brew install php56 --without-snmp --with-cgi --with-debug --with-homebrew-openssl --with-imap --with-intl --with-mysql\n",[41,294,295],{"__ignoreMap":39},[44,296,297,299,301,304,307,310,313,316,319,322,325],{"class":46,"line":47},[44,298,51],{"class":50},[44,300,162],{"class":54},[44,302,303],{"class":54}," install",[44,305,306],{"class":54}," php56",[44,308,309],{"class":58}," --without-snmp",[44,311,312],{"class":58}," --with-cgi",[44,314,315],{"class":58}," --with-debug",[44,317,318],{"class":58}," --with-homebrew-openssl",[44,320,321],{"class":58}," --with-imap",[44,323,324],{"class":58}," --with-intl",[44,326,327],{"class":58}," --with-mysql\n",[12,329,330],{},"Install some PHP extensions:",[34,332,334],{"className":36,"code":333,"language":38,"meta":39,"style":39},"$ brew install php56-mcrypt\n$ brew install php56-xdebug\n$ brew install php56-imagick\n",[41,335,336,347,358],{"__ignoreMap":39},[44,337,338,340,342,344],{"class":46,"line":47},[44,339,51],{"class":50},[44,341,162],{"class":54},[44,343,303],{"class":54},[44,345,346],{"class":54}," php56-mcrypt\n",[44,348,349,351,353,355],{"class":46,"line":110},[44,350,51],{"class":50},[44,352,162],{"class":54},[44,354,303],{"class":54},[44,356,357],{"class":54}," php56-xdebug\n",[44,359,360,362,364,366],{"class":46,"line":265},[44,361,51],{"class":50},[44,363,162],{"class":54},[44,365,303],{"class":54},[44,367,368],{"class":54}," php56-imagick\n",[12,370,371,372,375],{},"Edit ",[41,373,374],{},"\u002Fusr\u002Flocal\u002Fetc\u002Fphp\u002F5.6\u002Fphp.ini"," and change settings appropriately. At a minimum, you should change:",[34,377,381],{"className":378,"code":379,"language":380,"meta":39,"style":39},"language-ini shiki shiki-themes github-light-default github-light-default github-dark-default","date.timezone = \"Europe\u002FZurich\"\nerror_reporting  =  E_ALL\ndisplay_errors = On\npdo_mysql.default_socket=\nmysql.default_socket=\n","ini",[41,382,383,396,404,412,420],{"__ignoreMap":39},[44,384,385,389,393],{"class":46,"line":47},[44,386,388],{"class":387},"s5nWI","date.timezone",[44,390,392],{"class":391},"s_bOF"," = ",[44,394,395],{"class":54},"\"Europe\u002FZurich\"\n",[44,397,398,401],{"class":46,"line":110},[44,399,400],{"class":387},"error_reporting",[44,402,403],{"class":391},"  =  E_ALL\n",[44,405,406,409],{"class":46,"line":265},[44,407,408],{"class":387},"display_errors",[44,410,411],{"class":391}," = On\n",[44,413,414,417],{"class":46,"line":277},[44,415,416],{"class":387},"pdo_mysql.default_socket",[44,418,419],{"class":391},"=\n",[44,421,423,426],{"class":46,"line":422},5,[44,424,425],{"class":387},"mysql.default_socket",[44,427,419],{"class":391},[12,429,430,431,434],{},"We don't need to restart Apache after any modifications in ",[41,432,433],{},"php.ini"," as we are going to run PHP as CGI.",[24,436,438],{"id":437},"composer","Composer",[440,441,442,449],"ul",{},[443,444,445],"li",{},[16,446,438],{"href":447,"rel":448},"http:\u002F\u002Fgetcomposer.org\u002F",[20],[443,450,451],{},[16,452,455],{"href":453,"rel":454},"http:\u002F\u002Fpackagist.org\u002F",[20],"Packagist - Browse packages",[12,457,458,459,462,463,465,466,92],{},"As a PHP developer for sure you are going to use Composer! We are not going to install it directly in ",[41,460,461],{},"\u002Fusr\u002Flocal\u002Fbin"," as this directory is write-protected for the regular system user and we don't ever want to run Composer with ",[41,464,211],{},". Install it somewhere else and simply symlink it into ",[41,467,461],{},[34,469,471],{"className":36,"code":470,"language":38,"meta":39,"style":39},"$ mkdir -p \u002FApplications\u002FTools && cd \u002FApplications\u002FTools\u002F\n$ curl -sS https:\u002F\u002Fgetcomposer.org\u002Finstaller | php\n$ sudo ln -sf \u002FApplications\u002FTools\u002Fcomposer.phar \u002Fusr\u002Flocal\u002Fbin\u002Fcomposer\n",[41,472,473,495,514],{"__ignoreMap":39},[44,474,475,477,480,483,486,489,492],{"class":46,"line":47},[44,476,51],{"class":50},[44,478,479],{"class":54}," mkdir",[44,481,482],{"class":58}," -p",[44,484,485],{"class":54}," \u002FApplications\u002FTools",[44,487,488],{"class":391}," && ",[44,490,491],{"class":58},"cd",[44,493,494],{"class":54}," \u002FApplications\u002FTools\u002F\n",[44,496,497,499,502,505,508,511],{"class":46,"line":110},[44,498,51],{"class":50},[44,500,501],{"class":54}," curl",[44,503,504],{"class":58}," -sS",[44,506,507],{"class":54}," https:\u002F\u002Fgetcomposer.org\u002Finstaller",[44,509,510],{"class":387}," |",[44,512,513],{"class":50}," php\n",[44,515,516,518,520,522,525,528],{"class":46,"line":265},[44,517,51],{"class":50},[44,519,115],{"class":54},[44,521,138],{"class":54},[44,523,524],{"class":58}," -sf",[44,526,527],{"class":54}," \u002FApplications\u002FTools\u002Fcomposer.phar",[44,529,530],{"class":54}," \u002Fusr\u002Flocal\u002Fbin\u002Fcomposer\n",[12,532,533],{},"Upgrading Composer is terribly easy and does not require superuser rights:",[34,535,537],{"className":36,"code":536,"language":38,"meta":39,"style":39},"$ composer self-update\n",[41,538,539],{"__ignoreMap":39},[44,540,541,543,546],{"class":46,"line":47},[44,542,51],{"class":50},[44,544,545],{"class":54}," composer",[44,547,548],{"class":54}," self-update\n",[24,550,552],{"id":551},"mysql","MySQL",[12,554,555,556,559,560,565],{},"Download the ",[76,557,558],{},"\"Mac OS X 10.9 (x86, 64-bit), DMG Archive\""," from official ",[16,561,564],{"href":562,"rel":563},"https:\u002F\u002Fdev.mysql.com\u002Fdownloads\u002Fmysql\u002F",[20],"dev.mysql.com"," and install the following packages:",[440,567,568,573,578],{},[443,569,570],{},[76,571,572],{},"mysql-5.6.xx-osx10.9-x86_64.pkg",[443,574,575],{},[76,576,577],{},"MySQLStartupItem.pkg",[443,579,580],{},[76,581,582],{},"MySQL.prefPane",[12,584,585],{},"Then, open the pref pane and start the MySQL Server.",[12,587,588,589,592,593,596],{},"Update the path by editing ",[41,590,591],{},"\u002Fetc\u002Fbashrc"," (or ",[41,594,595],{},"~\u002F.bash_profile",") and add:",[34,598,600],{"className":36,"code":599,"language":38,"meta":39,"style":39},"export PATH=\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Flocal\u002Fmysql\u002Fbin:$PATH\n",[41,601,602],{"__ignoreMap":39},[44,603,604,607,610,613],{"class":46,"line":47},[44,605,606],{"class":387},"export",[44,608,609],{"class":391}," PATH",[44,611,612],{"class":387},"=",[44,614,615],{"class":391},"\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Flocal\u002Fmysql\u002Fbin:$PATH\n",[12,617,618],{},"at top of file.",[12,620,621],{},"Set up MySQL root password:",[34,623,625],{"className":36,"code":624,"language":38,"meta":39,"style":39},"$ mysqladmin -u root password {new-password}\n$ mysqladmin -u root -p{new-password} -h localhost password {new-password}\n$ mysqladmin -u root -p{new-password} reload\n",[41,626,627,646,674],{"__ignoreMap":39},[44,628,629,631,634,637,640,643],{"class":46,"line":47},[44,630,51],{"class":50},[44,632,633],{"class":54}," mysqladmin",[44,635,636],{"class":58}," -u",[44,638,639],{"class":54}," root",[44,641,642],{"class":54}," password",[44,644,645],{"class":54}," {new-password}\n",[44,647,648,650,652,654,656,658,661,664,667,670,672],{"class":46,"line":110},[44,649,51],{"class":50},[44,651,633],{"class":54},[44,653,636],{"class":58},[44,655,639],{"class":54},[44,657,482],{"class":58},[44,659,660],{"class":391},"{",[44,662,663],{"class":50},"new-password}",[44,665,666],{"class":58}," -h",[44,668,669],{"class":54}," localhost",[44,671,642],{"class":54},[44,673,645],{"class":54},[44,675,676,678,680,682,684,686,688,690],{"class":46,"line":265},[44,677,51],{"class":50},[44,679,633],{"class":54},[44,681,636],{"class":58},[44,683,639],{"class":54},[44,685,482],{"class":58},[44,687,660],{"class":391},[44,689,663],{"class":50},[44,691,692],{"class":54}," reload\n",[12,694,695,696,699,700,703],{},"Clear the history file by typing ",[41,697,698],{},"history -c"," so that ",[41,701,702],{},"{new-password}"," isn't in plain text on the disk!",[24,705,707],{"id":706},"apache","Apache",[12,709,710,711,92],{},"OS X Yosemite (10.10) ships with ",[76,712,713],{},"Apache 2.4.9",[34,715,717],{"className":36,"code":716,"language":38,"meta":39,"style":39},"$ apachectl -v\nServer version: Apache\u002F2.4.9 (Unix)\nServer built:   Sep  9 2014 14:48:20\n",[41,718,719,729,743],{"__ignoreMap":39},[44,720,721,723,726],{"class":46,"line":47},[44,722,51],{"class":50},[44,724,725],{"class":54}," apachectl",[44,727,728],{"class":58}," -v\n",[44,730,731,734,737,740],{"class":46,"line":110},[44,732,733],{"class":50},"Server",[44,735,736],{"class":54}," version:",[44,738,739],{"class":54}," Apache\u002F2.4.9",[44,741,742],{"class":391}," (Unix)\n",[44,744,745,747,750,753,756,759],{"class":46,"line":265},[44,746,733],{"class":50},[44,748,749],{"class":54}," built:",[44,751,752],{"class":54},"   Sep",[44,754,755],{"class":58},"  9",[44,757,758],{"class":58}," 2014",[44,760,761],{"class":54}," 14:48:20\n",[12,763,764],{},"This is great - no need for any other Apache installation! We just have to use the command line to start and stop it:",[34,766,768],{"className":36,"code":767,"language":38,"meta":39,"style":39},"$ sudo apachectl stop|start|restart\n",[41,769,770],{"__ignoreMap":39},[44,771,772,774,776,778,781,784,787,789],{"class":46,"line":47},[44,773,51],{"class":50},[44,775,115],{"class":54},[44,777,725],{"class":54},[44,779,780],{"class":54}," stop",[44,782,783],{"class":387},"|",[44,785,786],{"class":50},"start",[44,788,783],{"class":387},[44,790,791],{"class":50},"restart\n",[12,793,794,795,92],{},"Tune main Apache configuration in ",[41,796,797],{},"\u002Fetc\u002Fapache2\u002Fhttpd.conf",[440,799,800,803,806,813],{},[443,801,802],{},"enable some modules (remove the leading # from these lines)",[443,804,805],{},"change the default user Apache is running as to your system user (like this you don't run into any permission trouble in your own projects)",[443,807,808,809,812],{},"include ",[41,810,811],{},"\u002Fetc\u002Fapache2\u002Fextra\u002Fhttpd-vhosts.conf"," virtualhost configuration (see below)",[443,814,815],{},"set some environment variables",[34,817,821],{"className":818,"code":819,"filename":820,"language":706,"meta":39,"style":39},"language-apache shiki shiki-themes github-light-default github-light-default github-dark-default","# required for our PHP-as-CGI setup\nLoadModule cgi_module libexec\u002Fapache2\u002Fmod_cgi.so\nLoadModule actions_module libexec\u002Fapache2\u002Fmod_actions.so\n# required for rewriting in .htaccess\nLoadModule rewrite_module libexec\u002Fapache2\u002Fmod_rewrite.so\n \n# (...)\nUser youruser\nGroup _www\n \n# (...)\nInclude \u002Fprivate\u002Fetc\u002Fapache2\u002Fextra\u002Fhttpd-vhosts.conf\n \n# (...)\nSetEnv APPLICATION_ENV development\n","httpd.conf",[41,822,823,829,837,844,849,856,862,868,877,886,891,896,905,910,915],{"__ignoreMap":39},[44,824,825],{"class":46,"line":47},[44,826,828],{"class":827},"s9BHP","# required for our PHP-as-CGI setup\n",[44,830,831,834],{"class":46,"line":110},[44,832,833],{"class":387},"LoadModule",[44,835,836],{"class":391}," cgi_module libexec\u002Fapache2\u002Fmod_cgi.so\n",[44,838,839,841],{"class":46,"line":265},[44,840,833],{"class":387},[44,842,843],{"class":391}," actions_module libexec\u002Fapache2\u002Fmod_actions.so\n",[44,845,846],{"class":46,"line":277},[44,847,848],{"class":827},"# required for rewriting in .htaccess\n",[44,850,851,853],{"class":46,"line":422},[44,852,833],{"class":387},[44,854,855],{"class":391}," rewrite_module libexec\u002Fapache2\u002Fmod_rewrite.so\n",[44,857,859],{"class":46,"line":858},6,[44,860,861],{"class":391}," \n",[44,863,865],{"class":46,"line":864},7,[44,866,867],{"class":827},"# (...)\n",[44,869,871,874],{"class":46,"line":870},8,[44,872,873],{"class":387},"User",[44,875,876],{"class":391}," youruser\n",[44,878,880,883],{"class":46,"line":879},9,[44,881,882],{"class":387},"Group",[44,884,885],{"class":391}," _www\n",[44,887,889],{"class":46,"line":888},10,[44,890,861],{"class":391},[44,892,894],{"class":46,"line":893},11,[44,895,867],{"class":827},[44,897,899,902],{"class":46,"line":898},12,[44,900,901],{"class":387},"Include",[44,903,904],{"class":391}," \u002Fprivate\u002Fetc\u002Fapache2\u002Fextra\u002Fhttpd-vhosts.conf\n",[44,906,908],{"class":46,"line":907},13,[44,909,861],{"class":391},[44,911,913],{"class":46,"line":912},14,[44,914,867],{"class":827},[44,916,918,921],{"class":46,"line":917},15,[44,919,920],{"class":387},"SetEnv",[44,922,923],{"class":391}," APPLICATION_ENV development\n",[12,925,926,927,92],{},"Configure PHP as CGI in ",[41,928,929],{},"\u002Fetc\u002Fapache2\u002Fother\u002Fphp5.conf",[34,931,934],{"className":818,"code":932,"filename":933,"language":706,"meta":39,"style":39},"DirectoryIndex index.php index.html\n\n# Homebrew PHP 5.6\nScriptAlias \u002Fphpcgi \u002Fusr\u002Flocal\u002Fbin\u002Fphp-cgi\nAction php-cgi \u002Fphpcgi\nAddHandler php-cgi .php\n","other\u002Fphp5.conf",[41,935,936,944,950,955,966,974],{"__ignoreMap":39},[44,937,938,941],{"class":46,"line":47},[44,939,940],{"class":387},"DirectoryIndex",[44,942,943],{"class":391}," index.php index.html\n",[44,945,946],{"class":46,"line":110},[44,947,949],{"emptyLinePlaceholder":948},true,"\n",[44,951,952],{"class":46,"line":265},[44,953,954],{"class":827},"# Homebrew PHP 5.6\n",[44,956,957,960,963],{"class":46,"line":277},[44,958,959],{"class":387},"ScriptAlias",[44,961,962],{"class":54}," \u002Fphpcgi",[44,964,965],{"class":54}," \u002Fusr\u002Flocal\u002Fbin\u002Fphp-cgi\n",[44,967,968,971],{"class":46,"line":422},[44,969,970],{"class":387},"Action",[44,972,973],{"class":391}," php-cgi \u002Fphpcgi\n",[44,975,976,979],{"class":46,"line":858},[44,977,978],{"class":387},"AddHandler",[44,980,981],{"class":391}," php-cgi .php\n",[12,983,984,985,987],{},"Comment out the examples in ",[41,986,811],{}," and add the following lines:",[34,989,992],{"className":818,"code":990,"filename":991,"language":706,"meta":39,"style":39},"# Override the default httpd.conf directives. Make sure to\n# use 'Require all granted' to prevent 403 Forbidden message.\nOptions ExecCGI SymLinksIfOwnerMatch Indexes\nAllowOverride Indexes AuthConfig Limit FileInfo Options=Indexes,MultiViews\nRequire all granted\n\n#\n# Use name-based virtual hosting.\n#\nNameVirtualHost *:80\n\n#\n# The first VirtualHost section is used for all requests that do not\n# match a ServerName or ServerAlias in any block.\n#\nDocumentRoot \"\u002FLibrary\u002FWebServer\u002FDocuments\"\n\u003CDirectory \"\u002FLibrary\u002FWebServer\u002FDocuments\">\n    Options Indexes FollowSymLinks MultiViews\n    AllowOverride None\n    Require all granted\n\u003C\u002FDirectory>\n","extra\u002Fhttpd-vhosts.conf",[41,993,994,999,1004,1012,1025,1033,1037,1042,1047,1051,1062,1066,1070,1075,1080,1084,1093,1108,1117,1126,1134],{"__ignoreMap":39},[44,995,996],{"class":46,"line":47},[44,997,998],{"class":827},"# Override the default httpd.conf directives. Make sure to\n",[44,1000,1001],{"class":46,"line":110},[44,1002,1003],{"class":827},"# use 'Require all granted' to prevent 403 Forbidden message.\n",[44,1005,1006,1009],{"class":46,"line":265},[44,1007,1008],{"class":387},"Options",[44,1010,1011],{"class":391}," ExecCGI SymLinksIfOwnerMatch Indexes\n",[44,1013,1014,1017,1020,1022],{"class":46,"line":277},[44,1015,1016],{"class":387},"AllowOverride",[44,1018,1019],{"class":391}," Indexes AuthConfig Limit FileInfo ",[44,1021,1008],{"class":387},[44,1023,1024],{"class":391},"=Indexes,MultiViews\n",[44,1026,1027,1030],{"class":46,"line":422},[44,1028,1029],{"class":387},"Require",[44,1031,1032],{"class":391}," all granted\n",[44,1034,1035],{"class":46,"line":858},[44,1036,949],{"emptyLinePlaceholder":948},[44,1038,1039],{"class":46,"line":864},[44,1040,1041],{"class":827},"#\n",[44,1043,1044],{"class":46,"line":870},[44,1045,1046],{"class":827},"# Use name-based virtual hosting.\n",[44,1048,1049],{"class":46,"line":879},[44,1050,1041],{"class":827},[44,1052,1053,1056,1059],{"class":46,"line":888},[44,1054,1055],{"class":387},"NameVirtualHost",[44,1057,1058],{"class":391}," *:",[44,1060,1061],{"class":58},"80\n",[44,1063,1064],{"class":46,"line":893},[44,1065,949],{"emptyLinePlaceholder":948},[44,1067,1068],{"class":46,"line":898},[44,1069,1041],{"class":827},[44,1071,1072],{"class":46,"line":907},[44,1073,1074],{"class":827},"# The first VirtualHost section is used for all requests that do not\n",[44,1076,1077],{"class":46,"line":912},[44,1078,1079],{"class":827},"# match a ServerName or ServerAlias in any block.\n",[44,1081,1082],{"class":46,"line":917},[44,1083,1041],{"class":827},[44,1085,1087,1090],{"class":46,"line":1086},16,[44,1088,1089],{"class":387},"DocumentRoot",[44,1091,1092],{"class":391}," \"\u002FLibrary\u002FWebServer\u002FDocuments\"\n",[44,1094,1096,1099,1102,1105],{"class":46,"line":1095},17,[44,1097,1098],{"class":391},"\u003C",[44,1100,1101],{"class":58},"Directory",[44,1103,1104],{"class":54}," \"\u002FLibrary\u002FWebServer\u002FDocuments\"",[44,1106,1107],{"class":391},">\n",[44,1109,1111,1114],{"class":46,"line":1110},18,[44,1112,1113],{"class":387},"    Options",[44,1115,1116],{"class":391}," Indexes FollowSymLinks MultiViews\n",[44,1118,1120,1123],{"class":46,"line":1119},19,[44,1121,1122],{"class":387},"    AllowOverride",[44,1124,1125],{"class":391}," None\n",[44,1127,1129,1132],{"class":46,"line":1128},20,[44,1130,1131],{"class":387},"    Require",[44,1133,1032],{"class":391},[44,1135,1137,1140,1142],{"class":46,"line":1136},21,[44,1138,1139],{"class":391},"\u003C\u002F",[44,1141,1101],{"class":58},[44,1143,1107],{"class":391},[12,1145,1146],{},"You may then add all your VirtualHosts at the bottom of this file, e.g.:",[34,1148,1150],{"className":818,"code":1149,"filename":991,"language":706,"meta":39,"style":39},"\u003CVirtualHost *:80>\n    DocumentRoot \"\u002Fpath\u002Fto\u002Fyour\u002Fproject\u002Fpublic\"\n    ServerName demoproject.test\n\u003C\u002FVirtualHost>\n",[41,1151,1152,1164,1172,1180],{"__ignoreMap":39},[44,1153,1154,1156,1159,1162],{"class":46,"line":47},[44,1155,1098],{"class":391},[44,1157,1158],{"class":58},"VirtualHost",[44,1160,1161],{"class":54}," *:80",[44,1163,1107],{"class":391},[44,1165,1166,1169],{"class":46,"line":110},[44,1167,1168],{"class":387},"    DocumentRoot",[44,1170,1171],{"class":391}," \"\u002Fpath\u002Fto\u002Fyour\u002Fproject\u002Fpublic\"\n",[44,1173,1174,1177],{"class":46,"line":265},[44,1175,1176],{"class":387},"    ServerName",[44,1178,1179],{"class":391}," demoproject.test\n",[44,1181,1182,1184,1186],{"class":46,"line":277},[44,1183,1139],{"class":391},[44,1185,1158],{"class":58},[44,1187,1107],{"class":391},[12,1189,1190,1191,92],{},"Now, add the project's hostname to ",[41,1192,1193],{},"\u002Fetc\u002Fhosts",[34,1195,1200],{"className":1196,"code":1198,"language":1199},[1197],"language-text","127.0.0.1       demoproject.test\n","text",[41,1201,1198],{"__ignoreMap":39},[12,1203,1204,1205,92],{},"Flush the local DNS cache after every modification in ",[41,1206,1193],{},[34,1208,1210],{"className":36,"code":1209,"language":38,"meta":39,"style":39},"$ dscacheutil -flushcache\n",[41,1211,1212],{"__ignoreMap":39},[44,1213,1214,1216,1219],{"class":46,"line":47},[44,1215,51],{"class":50},[44,1217,1218],{"class":54}," dscacheutil",[44,1220,1221],{"class":58}," -flushcache\n",[12,1223,1224],{},"Create a phpinfo.php for testing:",[34,1226,1228],{"className":36,"code":1227,"language":38,"meta":39,"style":39},"$ echo \"\u003C?php phpinfo();\" > \u002FLibrary\u002FWebServer\u002FDocuments\u002Fphpinfo.php\n",[41,1229,1230],{"__ignoreMap":39},[44,1231,1232,1234,1237,1240,1243],{"class":46,"line":47},[44,1233,51],{"class":50},[44,1235,1236],{"class":54}," echo",[44,1238,1239],{"class":54}," \"\u003C?php phpinfo();\"",[44,1241,1242],{"class":387}," >",[44,1244,1245],{"class":54}," \u002FLibrary\u002FWebServer\u002FDocuments\u002Fphpinfo.php\n",[12,1247,1248],{},"Finally, test configuration and restart Apache:",[34,1250,1252],{"className":36,"code":1251,"language":38,"meta":39,"style":39},"$ apachectl configtest\n$ sudo apachectl restart\n",[41,1253,1254,1263],{"__ignoreMap":39},[44,1255,1256,1258,1260],{"class":46,"line":47},[44,1257,51],{"class":50},[44,1259,725],{"class":54},[44,1261,1262],{"class":54}," configtest\n",[44,1264,1265,1267,1269,1271],{"class":46,"line":110},[44,1266,51],{"class":50},[44,1268,115],{"class":54},[44,1270,725],{"class":54},[44,1272,1273],{"class":54}," restart\n",[12,1275,1276],{},"Testing:",[440,1278,1279,1285],{},[443,1280,1281],{},[16,1282,1283],{"href":1283,"rel":1284},"http:\u002F\u002Flocalhost\u002Fphpinfo.php",[20],[443,1286,1287],{},[16,1288,1289],{"href":1289,"rel":1290},"http:\u002F\u002Fdemoproject.test",[20],[1292,1293,1294],"style",{},"html pre.shiki code .sQJ0q, html code.shiki .sQJ0q{--shiki-light:#953800;--shiki-default:#953800;--shiki-dark:#FFA657}html pre.shiki code .s-BGO, html code.shiki .s-BGO{--shiki-light:#0A3069;--shiki-default:#0A3069;--shiki-dark:#A5D6FF}html pre.shiki code .sDkKp, html code.shiki .sDkKp{--shiki-light:#0550AE;--shiki-default:#0550AE;--shiki-dark:#79C0FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s5nWI, html code.shiki .s5nWI{--shiki-light:#CF222E;--shiki-default:#CF222E;--shiki-dark:#FF7B72}html pre.shiki code .s_bOF, html code.shiki .s_bOF{--shiki-light:#1F2328;--shiki-default:#1F2328;--shiki-dark:#E6EDF3}html pre.shiki code .s9BHP, html code.shiki .s9BHP{--shiki-light:#6E7781;--shiki-default:#6E7781;--shiki-dark:#8B949E}",{"title":39,"searchDepth":110,"depth":265,"links":1296},[1297,1298,1299,1300,1301],{"id":26,"depth":110,"text":21},{"id":215,"depth":110,"text":216},{"id":437,"depth":110,"text":438},{"id":551,"depth":110,"text":552},{"id":706,"depth":110,"text":707},null,"2014-10-20","Set up a dev environment on OS X Yosemite with PHP, MySQL, Apache.",{"type":9,"value":1306},[1307],[12,1308,14,1309,22],{},[16,1310,21],{"href":18,"rel":1311},[20],"md","\u002Fimages\u002Fcovers\u002Fosx-yosemite-php.jpg",{},"\u002Farticles\u002F20141020-osx-yosemite-php-mysql",false,{"title":6,"description":1304},"articles\u002F20141020-osx-yosemite-php-mysql",[1320,215,551,706],"macos","OmbhqBMQqPfLrw9gcbhfxI2hBlYT8aI9E3plVQ4_bvo",[1323,1328],{"title":1324,"path":1325,"stem":1326,"createdAt":1327,"children":-1},"Sendmail-Wrapper for PHP","\u002Farticles\u002F20140324-php-sendmail-wrapper","articles\u002F20140324-php-sendmail-wrapper","2014-03-24",{"title":1329,"path":1330,"stem":1331,"createdAt":1332,"children":-1},"Install Composer with Ansible, the lean way","\u002Farticles\u002F20160607-ansible-composer-install","articles\u002F20160607-ansible-composer-install","2016-06-07",1794961391547]