久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <legend id='scFSS'><style id='scFSS'><dir id='scFSS'><q id='scFSS'></q></dir></style></legend>
      <bdo id='scFSS'></bdo><ul id='scFSS'></ul>

    <small id='scFSS'></small><noframes id='scFSS'>

  1. <tfoot id='scFSS'></tfoot>
    <i id='scFSS'><tr id='scFSS'><dt id='scFSS'><q id='scFSS'><span id='scFSS'><b id='scFSS'><form id='scFSS'><ins id='scFSS'></ins><ul id='scFSS'></ul><sub id='scFSS'></sub></form><legend id='scFSS'></legend><bdo id='scFSS'><pre id='scFSS'><center id='scFSS'></center></pre></bdo></b><th id='scFSS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='scFSS'><tfoot id='scFSS'></tfoot><dl id='scFSS'><fieldset id='scFSS'></fieldset></dl></div>
    1. Docker-Compose 不會(huì)處理我的 php.ini 文件

      Docker-Compose won#39;t volume my php.ini file(Docker-Compose 不會(huì)處理我的 php.ini 文件)
            <bdo id='aP4as'></bdo><ul id='aP4as'></ul>

          • <small id='aP4as'></small><noframes id='aP4as'>

          • <legend id='aP4as'><style id='aP4as'><dir id='aP4as'><q id='aP4as'></q></dir></style></legend>

            1. <tfoot id='aP4as'></tfoot>
              <i id='aP4as'><tr id='aP4as'><dt id='aP4as'><q id='aP4as'><span id='aP4as'><b id='aP4as'><form id='aP4as'><ins id='aP4as'></ins><ul id='aP4as'></ul><sub id='aP4as'></sub></form><legend id='aP4as'></legend><bdo id='aP4as'><pre id='aP4as'><center id='aP4as'></center></pre></bdo></b><th id='aP4as'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='aP4as'><tfoot id='aP4as'></tfoot><dl id='aP4as'><fieldset id='aP4as'></fieldset></dl></div>
                <tbody id='aP4as'></tbody>
                本文介紹了Docker-Compose 不會(huì)處理我的 php.ini 文件的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我正在嘗試使用 docker-compose 來(lái)處理我的 php.ini 文件,以便我可以在本地機(jī)器上即時(shí)進(jìn)行更改,以查看它如何影響主機(jī).不幸的是,到目前為止,我能夠?qū)?php.ini 文件放入容器的唯一方法是直接在 Dockerfile 中創(chuàng)建.

                附件是使用下面的當(dāng)前設(shè)置正常運(yùn)行的容器的圖像.

                我的 Dockerfile 如下:

                來(lái)自 ubuntu:14.04維護(hù)者 Joe Astrahan 音量 ["/var/www"]運(yùn)行 apt-get 更新 &&apt-get install -y software-properties-common &&apt-get 更新 &&apt-get install -y 阿帕奇2卷曲libcurl3 libcurl3-dev php5php5-cli libapache2-mod-php5 php5-gd php5-json php5-ldap php5-mysqlnd php5-pgsql php5-curl mysql客戶(hù)端復(fù)制配置/php.ini/etc/php5/apache2/php.ini# 安裝 php-5.5.30復(fù)制 config/install_php-5.5.30.sh/tmp/install_php-5.5.30.sh運(yùn)行/bin/bash/tmp/install_php-5.5.30.sh復(fù)制配置/apache_default.conf/etc/apache2/sites-available/000-default.conf復(fù)制配置/運(yùn)行/usr/local/bin/run運(yùn)行 chmod +x/usr/local/bin/run運(yùn)行 a2enmod 重寫(xiě)#這將允許我們?cè)谛枰獣r(shí)修改容器中的文件進(jìn)行測(cè)試運(yùn)行 apt-get 更新 &&apt-get install -y vim曝光 80CMD ["/usr/local/bin/run"]

                我的 docker-compose.yml 文件如下:

                版本:'2'服務(wù):直播:圖像:mysql:5.5.52卷:- ./db_data_live:/var/lib/mysql重啟:總是環(huán)境:MYSQL_ROOT_PASSWORD: ****MYSQL_DATABASE:****MYSQL_USER:****MYSQL_PASSWORD: ****數(shù)據(jù)庫(kù)開(kāi)發(fā):圖像:mysql:5.5.52卷:- ./db_data_dev:/var/lib/mysql重啟:總是環(huán)境:MYSQL_ROOT_PASSWORD:****MYSQL_DATABASE:****MYSQL_USER:****MYSQL_PASSWORD: ****phpmyadmin:依賴(lài)于取決于:- dblive- 數(shù)據(jù)庫(kù)開(kāi)發(fā)圖片:phpmyadmin/phpmyadmin環(huán)境:PMA_任意:1重啟:總是端口:- 8081:80"網(wǎng)絡(luò):建造: ./依賴(lài)于取決于:- dblive- 數(shù)據(jù)庫(kù)開(kāi)發(fā)卷:- ./web:/var/www- ./config/php.ini:/etc/php5/apache2/conf.d/custom.ini- ./logs/apache_error.log:/var/log/apache2/error.log- ./logs/apache_access.log:/var/log/apache2/access.log- ./config/apache_default.conf:/etc/apache2/sites-enabled/000-default.conf重啟:總是端口:- 80:80"- 443:443"

                我嘗試遵循此處的建議,

                使用的額外文件

                運(yùn)行

                #!/bin/bash設(shè)置 -ePHP_ERROR_REPORTING=${PHP_ERROR_REPORTING:-"E_ALL & ~E_DEPRECATED & ~E_NOTICE"}sed -ri 's/^display_errorss*=s*Off/display_errors = On/g'/etc/php5/apache2/php.inised -ri 's/^display_errorss*=s*Off/display_errors = On/g'/etc/php5/cli/php.inised -ri "s/^error_reportings*=.*$//g"/etc/php5/apache2/php.inised -ri "s/^error_reportings*=.*$//g"/etc/php5/cli/php.iniecho "error_reporting = $PHP_ERROR_REPORTING" >>/etc/php5/apache2/php.iniecho "error_reporting = $PHP_ERROR_REPORTING" >>/etc/php5/cli/php.inisource/etc/apache2/envvars &&執(zhí)行/usr/sbin/apache2 -DFOREGROUND

                install_php-5.5.30.sh

                #!/bin/bash# 安裝依賴(lài)apt-get -y 更新 &&apt-get install -y 構(gòu)建必不可少的apache2-dev libxml2-dev# 下載 PHP 5.5.30 源代碼cd/tmpcurl -fsSL http://php.net/get/php-5.5.30.tar.bz2/from/this/mirror |焦油 xjf -cd php-5.5.30# 配置構(gòu)建選項(xiàng)./configure --prefix=/usr --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/apache2/conf.d --disable-pdo --disable-json --啟用-mbstring --with-apxs2#編譯安裝NUM_CORES=`cat/proc/cpuinfo |grep處理器|wc -l`make -j $NUM_CORES進(jìn)行安裝# 配置擴(kuò)展目錄echo 'extension_dir="/usr/lib/php5/20121212"' >>/etc/php5/apache2/php.ini# 清理rm -rf/tmp/php-5.5.30/tmp/install_php-5.5.30.sh

                我的文件結(jié)構(gòu)

                解決方案

                我找到了答案,將名為 custom.php.ini 的文件放在 config 目錄中(如果您遵循我的目錄結(jié)構(gòu)).

                在我的例子中像這樣設(shè)置音量...

                卷:- ./web:/var/www- ./config/custom.php.ini:/etc/php5/apache2/conf.d/custom.php.ini

                默認(rèn)情況下,額外 php 文件的掃描目錄將在 conf.d 目錄中查找.這些文件將覆蓋主 php.ini 的設(shè)置.我使用 asp_tag 選項(xiàng)將其關(guān)閉和打開(kāi)進(jìn)行了測(cè)試.只要您執(zhí)行以下操作,它就可以正常工作.

                完成這項(xiàng)工作的技巧是使用 docker-compose down 而不是 docker-compose kill

                這會(huì)刪除容器及其緩存文件.PHP 僅在啟動(dòng)時(shí)加載一次配置文件和其他文件,因此更改 php.ini 或自定義文件后需要此 docker-compose down 以強(qiáng)制更改.

                I'm trying to use docker-compose to volume my php.ini file so I can make changes on the fly on my local machine to see how it affects the host machine. Unfortunately the only way I've been able to get the php.ini file into the container is directly during creation in the Dockerfile so far.

                Attached is an image of the container running fine with the current settings below.

                My Dockerfile is below:

                FROM ubuntu:14.04
                MAINTAINER Joe Astrahan <jastrahan@poolservice.software>
                
                VOLUME ["/var/www"]
                
                
                RUN apt-get update && 
                    apt-get install -y software-properties-common && 
                    apt-get update && 
                    apt-get install -y 
                      apache2 
                      curl 
                      libcurl3 
                      libcurl3-dev 
                      php5 
                      php5-cli 
                      libapache2-mod-php5 
                      php5-gd 
                      php5-json 
                      php5-ldap 
                      php5-mysqlnd 
                      php5-pgsql 
                      php5-curl 
                      mysql-client
                
                COPY config/php.ini /etc/php5/apache2/php.ini
                
                # install php-5.5.30
                COPY config/install_php-5.5.30.sh /tmp/install_php-5.5.30.sh
                RUN /bin/bash /tmp/install_php-5.5.30.sh
                
                
                COPY config/apache_default.conf /etc/apache2/sites-available/000-default.conf
                COPY config/run /usr/local/bin/run
                
                RUN chmod +x /usr/local/bin/run
                RUN a2enmod rewrite
                
                #This will allow us to modify files in the container for testing if we need to
                RUN apt-get update && 
                    apt-get install -y vim
                
                EXPOSE 80
                CMD ["/usr/local/bin/run"]
                

                My docker-compose.yml file is below:

                version: '2'
                services:
                    dblive:
                        image: mysql:5.5.52
                        volumes:
                            - ./db_data_live:/var/lib/mysql
                        restart: always
                        environment:
                            MYSQL_ROOT_PASSWORD: ****
                            MYSQL_DATABASE: ****
                            MYSQL_USER: ****
                            MYSQL_PASSWORD: ****
                
                    dbdev:
                        image: mysql:5.5.52
                        volumes:
                            - ./db_data_dev:/var/lib/mysql
                        restart: always
                        environment:
                            MYSQL_ROOT_PASSWORD:****
                            MYSQL_DATABASE: ****
                            MYSQL_USER: ****
                            MYSQL_PASSWORD: ****
                
                    phpmyadmin:
                        depends_on:
                            - dblive
                            - dbdev
                        image: phpmyadmin/phpmyadmin
                        environment:
                            PMA_ARBITRARY : 1
                        restart: always
                        ports:
                            - "8081:80"
                
                    web:
                        build: ./
                        depends_on:
                            - dblive
                            - dbdev
                        volumes:
                            - ./web:/var/www
                            - ./config/php.ini:/etc/php5/apache2/conf.d/custom.ini
                            - ./logs/apache_error.log:/var/log/apache2/error.log
                            - ./logs/apache_access.log:/var/log/apache2/access.log
                            - ./config/apache_default.conf:/etc/apache2/sites-enabled/000-default.conf
                        restart: always
                        ports: 
                            - "80:80"
                            - "443:443"
                

                I tried following the advice here, can't upate php.ini file in Docker container, by creating a custom.ini file and mounting it in that location. I actually did it correctly I think because if you look at my image I attached for phpinfo(), you can see that under additional .ini files parsed my custom.ini is there at the end. I did a test though by setting asp_tags = On instead of Off and I can't. phpinfo() will always show it as off. Refer to my attached image of it showing it off despite loading my config file.

                I'm not even sure if its really honoring any of the commands in there at all?

                Extra Files Used

                Run

                #!/bin/bash
                set -e
                
                PHP_ERROR_REPORTING=${PHP_ERROR_REPORTING:-"E_ALL & ~E_DEPRECATED & ~E_NOTICE"}
                sed -ri 's/^display_errorss*=s*Off/display_errors = On/g' /etc/php5/apache2/php.ini
                sed -ri 's/^display_errorss*=s*Off/display_errors = On/g' /etc/php5/cli/php.ini
                sed -ri "s/^error_reportings*=.*$//g" /etc/php5/apache2/php.ini
                sed -ri "s/^error_reportings*=.*$//g" /etc/php5/cli/php.ini
                echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php5/apache2/php.ini
                echo "error_reporting = $PHP_ERROR_REPORTING" >> /etc/php5/cli/php.ini
                
                source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND
                

                install_php-5.5.30.sh

                #!/bin/bash
                
                # install dependencies
                apt-get -y update && 
                apt-get install -y 
                  build-essential 
                  apache2-dev 
                  libxml2-dev
                
                # download PHP 5.5.30 source code
                cd /tmp
                curl -fsSL http://php.net/get/php-5.5.30.tar.bz2/from/this/mirror | tar xjf -
                cd php-5.5.30
                
                # configure build options
                ./configure --prefix=/usr 
                            --with-config-file-path=/etc/php5/apache2 
                            --with-config-file-scan-dir=/etc/php5/apache2/conf.d 
                            --disable-pdo 
                            --disable-json 
                            --enable-mbstring 
                            --with-apxs2
                
                # compile and install
                NUM_CORES=`cat /proc/cpuinfo | grep processor | wc -l`
                make -j $NUM_CORES
                make install
                
                # configure extension directory
                echo 'extension_dir="/usr/lib/php5/20121212"' >> /etc/php5/apache2/php.ini
                
                # cleanup
                rm -rf /tmp/php-5.5.30 /tmp/install_php-5.5.30.sh
                

                My file structure

                解決方案

                I found the answer, put a file called custom.php.ini in the config directory (if you are following my directory structure).

                Set the volumes like this in my example...

                volumes:
                            - ./web:/var/www
                            - ./config/custom.php.ini:/etc/php5/apache2/conf.d/custom.php.ini
                

                By default the scan directory for extra php files will look in the conf.d directory. These files will overwrite the settings of the main php.ini. I tested this with the asp_tag option turning it Off and On. It works fine as long as you do the following below.

                The trick to making this work is to use docker-compose down instead of docker-compose kill

                This removes the containers and their cache files. PHP only loads the configuration file once at bootup and the other files so changing the php.ini or the custom file after requires this docker-compose down to force the change.

                這篇關(guān)于Docker-Compose 不會(huì)處理我的 php.ini 文件的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                  <i id='hzTnK'><tr id='hzTnK'><dt id='hzTnK'><q id='hzTnK'><span id='hzTnK'><b id='hzTnK'><form id='hzTnK'><ins id='hzTnK'></ins><ul id='hzTnK'></ul><sub id='hzTnK'></sub></form><legend id='hzTnK'></legend><bdo id='hzTnK'><pre id='hzTnK'><center id='hzTnK'></center></pre></bdo></b><th id='hzTnK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hzTnK'><tfoot id='hzTnK'></tfoot><dl id='hzTnK'><fieldset id='hzTnK'></fieldset></dl></div>

                  <small id='hzTnK'></small><noframes id='hzTnK'>

                    • <tfoot id='hzTnK'></tfoot>
                          <tbody id='hzTnK'></tbody>
                          <bdo id='hzTnK'></bdo><ul id='hzTnK'></ul>
                          <legend id='hzTnK'><style id='hzTnK'><dir id='hzTnK'><q id='hzTnK'></q></dir></style></legend>
                          主站蜘蛛池模板: 精品国产一级片 | 日韩精品成人免费观看视频 | 羞羞网站在线免费观看 | 国产高清在线观看 | 日韩中文一区二区三区 | 欧美一区二区视频 | 精品久久香蕉国产线看观看亚洲 | 国产亚洲欧美在线视频 | 九九一级片 | 二区在线视频 | 久久成人一区 | 精品欧美一区二区在线观看视频 | 日韩欧美三级电影在线观看 | 天堂资源最新在线 | 日韩成人免费 | 91国内精精品久久久久久婷婷 | 日韩av免费在线电影 | 99福利在线观看 | 人人叉 | 成人免费淫片aa视频免费 | 欧美日韩国产一区二区 | 男女那个视频 | 资源首页二三区 | 久久精品视频网站 | 久久com| 一级做a爰片久久毛片 | 免费一区二区三区 | 欧美国产激情 | 天天插天天操 | 欧美黑人体内she精在线观看 | 国产福利视频 | 97国产精品 | 亚洲欧美一区二区三区在线 | 久久91精品国产一区二区 | 成人一级视频在线观看 | 久久高清免费视频 | 亚洲国产成人av好男人在线观看 | 大象一区 | 国产xxxx在线| 日本不卡视频在线播放 | 亚洲一区二区久久久 |