contao / contao-manager

Contao Manager
GNU Lesser General Public License v3.0
86 stars 33 forks source link

Check for pdo_mysql #606

Closed fritzmg closed 3 years ago

fritzmg commented 3 years ago

If you install Contao without the pdo_mysql PHP extension being enabled/present, the following error will occur:

In FileLoader.php line 180:

  The file "…/contao/vendor/contao/manager-bundle/src/Resources/skeleton/config/config.yml" does not contain valid YAML: The constant "PDO::MYSQL_ATTR_MULTI_STATEMENTS" is not defined at line 52 (near "!php/const PDO::MYSQL_ATTR_MULTI_STATEMENTS: false") in …/contao/vendor/contao/manager-bundle/src/Resources/skeleton/config/config.yml (which is being imported from "…/contao/vendor/contao/manager-bundle/src/Resources/skeleton/config/config_prod.yml").                     

In YamlFileLoader.php line 693:

  The file "…/contao/vendor/contao/manager-bundle/src/Resources/skeleton/config/config.yml" does not contain valid YAML: The constant "PDO::MYSQL_ATTR_MULTI_STATEMENTS" is not defined at line 52 (near "!php/const PDO::MYSQL_ATTR_MULTI_STATEMENTS: false").                               

In Inline.php line 615:

  The constant "PDO::MYSQL_ATTR_MULTI_STATEMENTS" is not defined at line 52 (near "!php/const PDO::MYSQL_ATTR_MULTI_STATEMENTS: false").  

Thus the system check should check for PDO support in PHP.

See also https://community.contao.org/de/showthread.php?76224-Installationsfehler-Konstante-PDO-MYSQL_ATTR_MULTI_STATEMENTS

aschempp commented 3 years ago

if you don't have pdo_mysql, wouldn't that mean Contao can't be installed because that should be a requirement of DBAL or someone? Isn't that error rather specified to an old version of PDO?

Toflar commented 3 years ago

No, not of DBAL. Because it is an abstraction :D So why would it require pdo_mysql if you decide to use sqlite? It should be a requirement of contao/core-bundle indeed but the check should be added to the Manager nevertheless (Composer would just install an old version of Contao).

fritzmg commented 3 years ago

We could add the PHP extension requirement to contao/conflicts additionally.

aschempp commented 3 years ago

We shouldn't add that as discussed in https://github.com/contao/contao/pull/2459