當我清除緩存我有這樣的錯誤: SQLSTATE[HY000] [2002] Operation timed outSymfony的2.8清除緩存和超時
我使用symfony的2.8,在泊塢窗,撰寫(DB,PHP,phpMyAdmin的,nginx的) 我不沒有任何問題連接我的PHP碼頭到我的數據庫泊塢窗和網站的作品。但我想解決這個問題。 我試圖增加interactive_timeout感謝這篇文章「https://support.rackspace.com/how-to/how-to-change-the-mysql-timeout-on-a-server/」沒有什麼改變...
我有更新項目與作曲家相同的錯誤。如果有人有一個想法......
config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
- { resource: "@UserBundle/Resources/config/services.yml" }
parameters:
locale: en
framework:
translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
orm:
auto_generate_proxy_classes: "%kernel.debug%"
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
# FOS UserBundle Configuration
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: UserBundle\Entity\User
registration:
form:
type: UserBundle\Form\RegistrationType
confirmation:
from_email:
address: [email protected] # put a valid mail address
sender_name: Confimation link
enabled: false # pass to true to enable sending mail inscriptions
template: FOSUserBundle:Registration:email.txt.twig
profile:
form:
type: UserBundle\Form\ProfileFormType
resetting:
email:
template: UserBundle:Reset:password_resetting.email.twig
from_email:
address: [email protected] # put a valid mail address
sender_name: Reset link
parameters.yml:
# This file is auto-generated during the composer install
parameters:
database_host: 172.18.0.2
database_port: 3306
database_name: symfony
database_user: user
database_password: user_password
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
secret: my_secret
security.yml
security:
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADMIN:
- ROLE_USER
providers:
fos_userbundle:
id: fos_user.user_provider.username_email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
login_path:/
use_forward: false
check_path: fos_user_security_check
failure_path: null
default_target_path:/
remember_me: true
remember_me:
secret: %secret%
lifetime: 3000
path: /
domain: ˜
logout:
path: fos_user_security_logout
target:/
anonymous: true
switch_user: true
然後我的搬運工,撰寫。 yml:
version: '2'
services:
db:
image: mysql
ports:
- 3306:3306
volumes:
- "./.data/db:/var/lib/mysql"
- "./script:/stack"
environment:
MYSQL_ROOT_PASSWORD: user_password
command:
- "/stack/localdb-run.sh"
php:
build: php7-fpm
ports:
- 9000:9000
links:
- db:mysqldb
volumes:
- ./symfony:/var/www/symfony
- ./logs/symfony:/var/www/symfony/app/logs
nginx:
build: nginx
ports:
- 80:80
links:
- php
volumes_from:
- php
volumes:
- ./logs/nginx/:/var/log/nginx
phpmyadmin:
image: phpmyadmin/phpmyadmin:4.6.4-1
ports:
- "8080:80"
links:
- db
您可以發佈您parameter.yml和你config.yml請? – DOZ
完成:) @DOZ .... –
我覺得問題來自docker而不是Symfony。你可以發送你的'docker-compose.json'嗎? – Roukmoute