码迷,mamicode.com
首页 > 数据库 > 详细

centos6: mysql+nginx+php

时间:2016-06-27 13:40:18      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

mysql: http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
    yum repolist enabled | grep mysql

    rm -rf /etc/yum.repos.d/mysql*.config-file-path

    vim /etc/yum.repos.d/mysql-community.repo
    #note the baseurl, centos6 --> el6,  view the system version: uname -r
        # Enable to use MySQL 5.6
        [mysql56-community]
        name=MySQL 5.6 Community Server
        baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
        enabled=1
        gpgcheck=1
        gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

    yum install mysql-community-server 
    
    service mysqld start
    
    mysql -uroot -p 
    create user vagrant@% identified by vagrant;  
    grant all privileges on *.* to vagrant@%identified by password;
    
PHP:
    tar -zxvf php-5.6.23.tar.gz -C /usr/local/src
    cd php-5.6.23
    mkdir -p /usr/local/php5
    ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pear --with-gettext --enable-session --with-mcrypt --with-curl
    make 
    make install
    cp php.ini-production /usr/local/php5/etc/php.ini
    rm -rf /etc/php.ini
    ln -s /usr/local/php5/etc/php.ini /etc/php.ini
    cp /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.conf 
    vi /usr/local/php5/etc/php-fpm.conf    
    pid = run/php-fpm.pid #取消前面的分号
    cp /usr/local/src/php-5.5.10/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm#拷贝php-fpm到启动目录
    chmod +x /etc/rc.d/init.d/php-fpm #添加执行权限
    chkconfig php-fpm on #设置开机启动
    vi /usr/local/php5/etc/php.ini #编辑配置文件
    修改为:date.timezone = PRC #设置时区
    
    vim /etc/profile
        export PATH=$PATH:/usr/local/php5/bin
    source /etc/profile
    
    
nginx:
    sudo salt-call --local state.sls nginx saltenv="local"
    
    vim /etc/nginx/nginx.conf
        #include /etc/nginx/conf.d/*.conf;   #去掉行首的#, 
        
    vim /etc/nginx/conf.d/php-dev.conf
        server
        {
            listen 80;
            server_name php-dev.jobstreet.com;
            index index.html index.htm index.php;
            root /var/www/html;

            location ~ \.php$ {
                include fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            }
        }

PHP Demo:
    Composer: http://pkg.phpcomposer.com/        
        php -r "readfile(‘https://getcomposer.org/installer‘);" > composer-setup.php
        php composer-setup.php
        php -r "unlink(‘composer-setup.php‘);"
        mv composer.phar /usr/local/bin/composer
        
    Laravel: https://github.com/johnlui/Learn-Laravel-5/issues/4

 

centos6: mysql+nginx+php

标签:

原文地址:http://www.cnblogs.com/dfg727/p/5619762.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!