dongtun3259 2018-12-04 14:36
浏览 35

为什么App Engine没有SQL Server驱动程序?

I am trying to install SQL Server drivers on a custom runtime for PHP on App Engine Flex. If I leave out location the Nginx conf file it will download the correction index.php page (it is a Laravel app). Without any Nginx conf file it will assume to look for a index.php inside the root of my application. My question is, How does App Flex Engine handle custom PHP runtimes? Do I need a nginx.conf file? I am getting an address already binded error.

Here is my Dockerfile;

FROM gcr.io/google-appengine/php
RUN mkdir -p /usr/share/nginx/www/
ADD . /usr/share/nginx/www/
RUN chmod -R a+r /usr/share/nginx/www

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN apt-get update && apt-get -y install apt-transport-https curl
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN exit
RUN apt-get update -y
RUN ACCEPT_EULA=Y apt-get install msodbcsql17 -y
RUN pecl channel-update pecl.php.net
RUN apt-get install unixodbc-dev -y
RUN apt-get install autoconf -y
RUN apt-get install build-essential -y
RUN apt-get install gcc -y
RUN apt-get install g++ -y
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv
RUN echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini
RUN echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini
RUN mkdir -p /usr/share/nginx/www/_ah && \
    echo "healthy" > /usr/share/nginx/www/_ah/health
EXPOSE 8080

and my Nginx file

# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

events {
    worker_connections 768;
}

http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    # Logs will appear on the Google Developer's Console when logged to this
    # directory.
    access_log /var/log/app_engine/app.log;
    error_log /var/log/app_engine/app.log;

    gzip on;
    gzip_disable "msie6";

    server {
        # Google App Engine expects the runtime to serve HTTP traffic from
        # port 8080.
        listen 8080;
        root /usr/share/nginx/www/public;
        index index.html index.htm index.php;
        location / {
          try_files $uri?$args $uri/index.php?$args;
        }
    }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题