symfony: [HttpFoundation] Missing ext-session in composer.json
Symfony version(s) affected: ^4.0
Purpose: Reconsider #27955 taking into account Docker containers (especially php:cli-alpine)
Description
Missing PHP session extension requirements in composer.json of symfony/http-foundation
How to reproduce
$ composer create-project symfony/skeleton
$ composer req debug

Possible Solution
"require": {
"ext-session": "*",
Additional context
@fabpot said :
(http://php.net/manual/en/session.installation.php: Session support is enabled in PHP by default.).
The next sentence of the doc is :
If you would not like to build your PHP with session support, you should specify the --disable-session option […]
$ php -m
[PHP Modules]
Core
ctype
date
dom
filter
hash
iconv
json
libxml
mbstring
openssl
pcre
PDO
pdo_sqlite
Phar
Reflection \
SimpleXML | no session
SPL /
sqlite3
standard
tokenizer
xml
xmlwriter
zlib
Please consider the waste of time building docker images with a symfony distribution without any error fetching the composer packages but which finally end up with a 500 starting the server.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 17 (15 by maintainers)
ok, let me think about the best way to do it.
Given the discussion, I’m on the side we should throw an exception when e.g.
session_startis not found inFrameworkExtensionand a similar one inNativeSessionStorage. PR welcome.After reading this discussion it looks like it’s impossible to implement this feature. Too many extensions depend on what your app actually uses, so it’s impossible to anticipate the requirements.
Instead of this, people would need a tool that executes locally and introspects your app (both your code and vendors code) and gives you the list of PHP extensions needed to run it.
Also, if we added
ext-sessionto the dependencies ofsymfony/http-foundation: If I only wanted to build a stateless API and thus disabled session support in Symfony, HttpFoundation should work fine withoutext-session, shouldn’t it? Maybe we should rather add a check to theFrameworkExtensionand throw a meaningful exception if someone tries to enable sessions with the native storage without havingext-sessionenabled.