Yesterday our server (ubuntu 16.04) was updated by “dist-upgrade” which installed php7.3. After manually installation of missing php-modules we got exceptions
like
Warning: "continue" targeting switch is equivalent to "break".
Did you mean to use "continue 2"? in ...
In our flow application based on flow 5.2 I could fix that by using “break” (line 164 in DataMapper) and “continue 2” (line 205 in DataMapper and line 311 in Compiler).
In another application bases on flow 4.2 additional exceptions are thrown in
Doctrine\ORM\UnitOfWork.php. Here any tries of fixing it end up in
“could not find driver” in Doctrine/DBAL/Driver/AbstractMySQLDriver.php
Unfortunately “composer update” fails with same error.
Two questions about this:
how can I check which php version uses the flow application und
how I get the exact flow version on command line or is the only way to look into “composer.json”?
Very annoying: the flow 4 bases application is heavly used by our company…
after getting composer working again, I ran “composer update” which updated
several packages.
“composer info” says now “neos/flow 5.2.3”.
After that I ran “./flow flow:cache:flush”, call to our flow app
in the browser ends up like the flow 4.2 application now:
An exception occurred in driver: could not find driver
Exception Code 0
Exception Type Doctrine\DBAL\Exception\DriverException
Thrown in File Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
Line 125
Nested Exception
could not find driver
Exception Code 0
Exception Type Doctrine\DBAL\Driver\PDOException
Thrown in File Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
Line 50
Nested Exception
could not find driver
Exception Code 0
Exception Type PDOException
Thrown in File Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
Line 46
In fact no libs were updated …
Additional Info: when I ran a CommandController which uses dababase it works!?
I initially did not have an idea, but your following hint gave me a clue:
I think that you are missing the corresponding pdo_mysql PHP extension in the web mode, while it is installed in CLI.
Further checking the source code of Doctrine, where the exception occurs, confirms this suspicion I think, as the error occurs at exactly this line where the PDO connection is built by the PHP PDO extension:
So, please ensure you have the PDO_MySQL Extension loaded both in CLI and in your PHP Web Server. How this works exactly depends a little on your setup, i.e. whether you run php_fpm or mod_php in Apache - but using phpinfo() , you should see that when called from CLI, the extension is loaded (e.g. by running php -i | grep -i pdo and looking for a line pdo_mysql); while from the web, you probably won’t find this line.
I’ve check “pdo_mysql” - as I know it’s part of “phpX.X-mysql” on ubuntu.
That was installed antomatically…
But: ahhhhhhhh! PHP CLI used PHP7.3 and apache used still PHP7.2!!
What a shit…
After a2dismod php7.2 and a2enmod php7.3 both applications are working now.
Your essential “keyword” was to look for “pdo_mysql” as a starting point.
Therefore I used dpkg -l | grep pdo and dpkg -l | grep mysql without further reading your post
Thank’s a lot, Seabstian!
Important for those who run in an equal situation: the pitfall is this on ubuntu:
The following package was automatically installed and is no longer required:
php7.2-mysql
Use 'apt autoremove' to remove it.
when doing a apt-get dist-upgrade while all other php7.2 modules are still on system AND usable!