【lookas2001的小课堂】Mac通过Homebrew安装、配置、运行Apache、PHP、MySQL

lookas2001 2016-02-28 17:52:24
#Install and Config brew sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" sudo brew tap homebrewpache sudo brew tap homebrew/php #Install App sudo brew install httpd24 mysql php56 sudo brew install composer #Config App #Apache sudo vi /usr/local/etcpache2/2.4/httpd.conf #Add LoadModule php5_module /usr/local/Cellar/php53/5.3.29/libexecpache2/libphp5.so IfModule mod_php5.c AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps IfModule mod_dir.c DirectoryIndex index.html index.php /IfModule /IfModule PHPIniDir /usr/local/etc/php/5.6/php.ini #网站配置信息在此配置(端口,默认文件夹) sudo brew services restart httpd26 #网站默认目录为:/usr/local/var/www/htdocs #MySQL sudo cp /usr/local/opt/mysql/support-files/my-default.cnf /usr/local/etc/my.cnf sudo mysql_secure_installation #按照提示安装 #数据库默认目录为:/usr/local/var/mysql #Composer #配置文件地址:/Users/{username}/.composer/composer.json #数据文件地址:/Users/{username}/.composer/vendor #Admin #Apache sudo brew services (start/restart/stop) httpd26 #MySQL sudo brew services (start/restart/stop) mysql sudo mysql -h{hostname} u{username} -p 参见: http://my.oschina.net/lonewolf/blog/390142 https://segmentfault.com/q/1010000000475470 http://zhidao.baidu.com/question/650058421097376525.html http://www.2cto.com/Article/201301/181327.html http://www.jb51.netrticle/28133.htm Tips: 运行某一目录(非环境变量)下文件要用全路径,如: /Users/cuihaiqin/.composer/vendor/laravel/installer/laravel new app ./laravel new app Mac默认Shell(命令行)为bash,bash配置环境变量路径为:/etc/profile /etc/paths ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc(详情参见:http://www.flakor.cn/2014-09-14-714.html)

评论

没有评论哟~