zoukankan      html  css  js  c++  java
  • Mac开发环境搭建

    参考文档一:Mac 开发者常用的工具

      补充:关闭Homebrew自动更新:export HOMEBREW_NO_AUTO_UPDATE=true

    参考文档二:高效 MacBook 工作环境配置

    IntelliJ IDEA 简体中文专题教程

    IntelliJ IDEA 相关技巧视频

    IntelliJ IDEA注册码

    1.svn
    1)Cornerstone.app
    2)shell
    svn cmd:http://blog.sina.com.cn/s/blog_963453200101eiuq.html

    2.git
    1)shell
    2)sourcetree

    3.apache php install
    apache,php使用mac自带的版本
    apache version:2.4.16
    php version:5.5.30
    下面所有的配置文件修改前请先备份!!

    3.1 apache
    3.1.1)apache 启动,重启,停止
    sudo apachectl start/restart/stop

    3.1.2)apache启动成功检查
    浏览器输入localhost,如显示It works,则启动成功

    3.1.3)apache 配置文件修改(/etc/apache2/httpd.conf)
    下面配置中#去掉
    #LoadModule php5_module libexec/apache2/libphp5.so
    #LoadModule rewrite_module libexec/apache2/mod_rewrite.so

    DirectoryIndex index.html改为:
    DirectoryIndex index.php Index.php index.html

    修改完成后重启apache

    3.1.4)检查php模块是否加载
    执行命令:echo "<?php phpinfo(); ?>"|sudo tee -a /Library/WebServer/Documents/index.php
    浏览器输入:http://localhost/index.php 查看php信息

    3.2 php extension install
    3.2.1)由于mac权限限制,需要修改权限
    mac 重启,按住command+R进入恢复模式,打开shell,关闭保护模式:csrutil disable

    3.2.2)将memcached.so/redis.so/msgpacki.so 复制到下面目录中:/usr/lib/php/extensions/no-debug-non-zts-20121212
    sudo cp *.so /usr/lib/php/extensions/no-debug-non-zts-20121212

    3.2.3)修改/etc/php.ini,添加扩展:
    extension=memcached.so
    extension=redis.so
    extension=msgpacki.so

    3.2.4)修改/etc/php.ini,修改session配置
    session.serialize_handler=php
    将php改为msgpacki

    3.2.5)重启apache,通过浏览器查看php扩展状态(见3.1.4)

    3.3 apache VirtualHost
    3.3.1)修改/etc/apache2/httpd.conf
    将该行#去掉
    #Include /private/etc/apache2/extra/httpd-vhosts.conf

    文件中添加:Listen 10001
    3.3.2)修改/etc/apache2/extra/httpd-vhosts.conf
    实例如下:

    <VirtualHost *:10001>
    DocumentRoot "/Users/sunlei/nonobank/php"
    ServerName 127.0.0.1:10001
    ServerAlias 127.0.0.1:10001
    ErrorLog "/private/var/log/apache2/nonobank-php-error_log"
    CustomLog "/private/var/log/apache2/nonobank-php-access_log" common
    <Directory "/Users/sunlei/nonobank/php">
    Options Indexes FollowSymLinks Includes
    AllowOverride all
    Order allow,deny
    Allow from all
    Require all granted
    </Directory>
    </VirtualHost>

    ps:/Users/sunlei/nonobank/php 为php代码目录

    修改php目录权限
    sudo chmod -R 777 /Users/sunlei/nonobank/php

    重启apache。浏览器输入127.0.0.1:10001 测试。

    3.4 php debug 配置
    以phpstorm为例:
    参考:http://www.php-note.com/article/detail/825

    /etc/php.ini 添加如下内容
    [XDebug]
    zend_extension = "/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
    xdebug.profiler_append = 0
    xdebug.profiler_enable = 1
    xdebug.profiler_enable_trigger = 0
    xdebug.profiler_output_dir = "/tmp"
    xdebug.profiler_output_name = "cachegrind.out.%t-%s"
    xdebug.remote_enable = 1
    xdebug.remote_handler = "dbgp"
    xdebug.remote_host = "127.0.0.1"
    xdebug.remote_port=9000
    xdebug.trace_output_dir = "/tmp"

    其他的按照上述链接配置即可。
    4.java
    idea,maven,jdk

    1)idea,phpstorm 激活server:http://idea.qinxi1992.cn
    2)mac系统配置JDK环境变量
    3)java_home 配置,修改/etc/profile,添加:
    JAVA_HOME=`/usr/libexec/java_home`
    export JAVA_HOME

    4)maven环境配置,修改/etc/profile,添加:
    MAVEN_HOME=/usr/local/apache-maven-3.3.9
    export MAVEN_HOME
    export PATH=$PATH:$MAVEN_HOME/bin

    5)执行命令
    source /etc/profile 是配置生效

  • 相关阅读:
    BZOJ4004: [JLOI2015]装备购买
    POJ3696:The Luckiest number
    BZOJ1053: [HAOI2007]反素数ant
    BZOJ1029: [JSOI2007]建筑抢修
    牛站(贪心+暴力做法)
    浅谈SPFA(没有特别的探讨,只是对某天晚上的思考做个记录)
    火车进栈问题(如何快速计算单个组合数)
    雷达设备
    畜栏预定
    防晒
  • 原文地址:https://www.cnblogs.com/cb0327/p/5342273.html
Copyright © 2011-2022 走看看