Fatal error: Uncaught Nette\DI\InvalidConfigurationException: Found section ‘php’ in configuration, but corres

6 months ago

yakimov
Backer | 1
+
0
-

Hi!

I am using Nette Di in my app.
I configured App and have error if i add section PHP.

config.neon

php:
  date.timezone: Europe/Moscow

parameters:
  twig:
    templates: 'templates'
    cache: 'temp/cache/'
  database:
    driver: 'pdo'
    dsn: 'mysql:host=127.0.0.1;dbname=feed_generator'
    user: root
    password:
    debug: true
    buffered: true

services:
  pdo:
    factory: PDO(%database.dsn%, %database.user%, %database.password%)
    setup:
      - setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false)
  database: Dibi\Connection([driver: %database.driver%, pdo: @pdo])
  twig: Twig\Environment(Twig\Loader\FilesystemLoader(%twig.templates%), [cache: %twig.cache%])
  FeedGenerator: Task\FeedGeneratorTask

Error

PHP Fatal error: Uncaught Nette\DI\InvalidConfigurationException: Found section ‘php’ in configuration, but corresponding extension is missing. in /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/Compiler.php:244
Stack trace:
#0 /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/Compiler.php(204): Nette\DI\Compiler->processExtensions()
#1 /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/ContainerLoader.php(119): Nette\DI\Compiler->compile()
#2 /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/ContainerLoader.php(79): Nette\DI\ContainerLoader->generate(‘Container_dcca4…’, Object(Closure))
#3 /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/ContainerLoader.php(44): Nette\DI\ContainerLoader->loadFile(‘Container_dcca4…’, Object(Closure))
#4 /Users/yakimov/Dev/feed-generator/bootstrap.php(9): Nette\DI\ContainerLoader->load(Object(Closure))
#5 /Users/yakimov/Dev/feed-generator/test.php(3): require(‘/Users/yakimov/…’)
#6 {main}
throw in /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/Compiler.php on line 244

Fatal error: Uncaught Nette\DI\InvalidConfigurationException: Found section ‘php’ in configuration, but corresponding extension is missing. in /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/Compiler.php on line 244

Nette\DI\InvalidConfigurationException: Found section ‘php’ in configuration, but corresponding extension is missing. in /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/Compiler.php on line 244

Call Stack:
0.0003 390600 1. {main}() /Users/yakimov/Dev/feed-generator/test.php:0
0.0005 393768 2. require(‘/Users/yakimov/Dev/feed-generator/bootstrap.php’) /Users/yakimov/Dev/feed-generator/test.php:3
0.0026 680008 3. Nette\DI\ContainerLoader->load() /Users/yakimov/Dev/feed-generator/bootstrap.php:9
0.0027 680056 4. Nette\DI\ContainerLoader->loadFile() /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/ContainerLoader.php:44
0.0034 754528 5. Nette\DI\ContainerLoader->generate() /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/ContainerLoader.php:79
0.0085 1391200 6. Nette\DI\Compiler->compile() /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/ContainerLoader.php:119
0.0085 1391200 7. Nette\DI\Compiler->processExtensions() /Users/yakimov/Dev/feed-generator/vendor/nette/di/src/DI/Compiler.php:204

Last edited by yakimov (2019-04-16 04:52)

6 months ago

Milo
Nette Core | 1150
+
0
-

The php is a DI container extension. And is automatically registered only when whole Nette Application is used.

https://github.com/…igurator.php

6 months ago

Milo
Nette Core | 1150
+
+2
-

From top of my head… try add to NEON config:

extensions:
    php: Nette\DI\Extensions\PhpExtension

13 days ago

Vojta123
Member | 1
+
0
-

Ahoj, přidal jsem do config.neon

extensions: php: Nette\DI\Extensions\PhpExtension

,ale teď mi to místo

Found section ‘dsn’ in configuration, but corresponding extension is missing

hlásí

Name ‘php’ is already used or reserved.

Nevíte co s tím ?

13 days ago

Šaman
Member | 2343
+
0
-

Založ nové vlákno a ukaž svůj config. Podle té druhé hlášky je problém úplně jinde (od boku bych hádal nekonzistentní mezery/taby). A jestli používáš plné Nette, tak PHP extenzi přidávat nemusíš nemáš.

Last edited by Šaman (2019-10-07 01:38)

10 days ago

dkorpar
Member | 73
+
+2
-

Why using Czech at english side of board??