使用Google App Engine进行Laravel部署:没有此类文件或目录

时间:2017-06-06 03:46:01

标签: php google-app-engine

我已经按照this教程创建了一个名为zoho_portal的数据库。我的app.yaml内容是:

runtime: php
env: flex

runtime_config:
  document_root: public

# required on some platforms so ".env" is not skipped
skip_files: false

    env_variables:
      # The values here will override those in ".env". This is useful for
      # production-specific configuration. However, feel free to set these
      # values in ".env" instead if you prefer.
      APP_LOG: errorlog
      STORAGE_DIR: /tmp
      CACHE_DRIVER: database
      SESSION_DRIVER: database
      ## Set these environment variables according to your CloudSQL configuration.
      DB_HOST: localhost
      DB_DATABASE: zoho_portal
      DB_USERNAME: USER
      DB_PASSWORD: PASS
      DB_SOCKET: /cloudsql/zoho-portal-159018:us-central1:zoho-portal 

    beta_settings:
        cloud_sql_instances: "zoho-portal-159018:us-central1:zoho-portal"

我还将此添加到我的composer.json

"post-deploy-cmd": [
    "chmod -R 755 bootstrap\/cache"
]

但是,在使用gcloud app deploy进行部署并访问网站https://zoho-portal-159018.appspot.com/后,我收到此错误:

  

SQLSTATE [HY000] [2002]没有这样的文件或目录(SQL:select * from   sessions其中id = iq8isoeEqTaj5xVNmVm0JuFKtR8vtSEB0ajJl23o限制   1)

据我所知,我没有错过本教程中列出的任何步骤,并且数据库设置正确。我也认为它与数据库迁移无关。据我所知,这是套接字文件设置方式的问题。

1 个答案:

答案 0 :(得分:0)

问题在于使用数据库作为会话驱动程序。临时解决方案是使用另一个驱动程序(memcached,redis)等