Undefined class constant 'MYSQL_ATTR_COMPRESS'
See original GitHub issueI get a 500 when visiting my site through a browser.
Output of nginx’s error.log
:
2016/05/24 00:49:00 [error] 5647#5647: *1 FastCGI sent in stderr: "PHP message: Undefined class constant 'MYSQL_ATTR_COMPRESS'
PHP message: [app/main/db/database.php:49] DB\Database->connect('mysql:host=localhost;port=3306;dbname=','pathfinder','pathfinder','censored')
PHP message: [app/main/db/database.php:18] DB\Database->setDB('PF')
PHP message: [app/lib/base.php:35] ReflectionClass->newInstanceArgs(array('PF'))
PHP message: [app/main/controller/controller.php:56] Prefab::instance('PF')
PHP message: [app/lib/base.php:1652] Controller\Controller->beforeroute(Base::__set_state(array('hive'=>array('HEADERS'=>array('Accept-Language'=>'en-US,en;q=0.8,da;q=0.6','Accept-Encoding'=>'gzip, deflate, sdch','Dnt'=>'1','User-Agent'=>'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36','Upgrade-Insecure-Requests'=>'1','Accept'=>'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8','Cache-Control'=>'max-age=0','Connection'=>'keep-alive','Host'=>'nobelnet.dk:5560'),'AGENT'=>'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36','AJAX'=>false,'ALIAS'=>'login','ALIASES'=>array('setup'=>'/setup','login'=>'/','sso'=>'/sso/@action','map'=>'/map'),'AUTOLOAD'=>'app/main/','BASE'=>'','BITMASK'=>2,'BODY'=>'','CACHE'=>'folder=tmp/cache/','CASELESS'=>true,'CONFIG'=>NULL,'CORS'=>array('headers'=>'','origin'=>false,'credentials'=>false,'expose'=>false,'ttl'=>0),'DEBUG'=>3,'DIACRITICS'=>a...
PHP message: [app/lib/base.php:1486] Base->call(array(ControllerAppController::__set_state(array()),'init'),array(Base::__set_state(array('hive'=>array('HEADERS'=>array('Accept-Language'=>'en-US,en;q=0.8,da;q=0.6','Accept-Encoding'=>'gzip, deflate, sdch','Dnt'=>'1','User-Agent'=>'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36','Upgrade-Insecure-Requests'=>'1','Accept'=>'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8','Cache-Control'=>'
I suspect I might have a wrong MySQL version (or wrong php extension?).
Somehow it works when I run the app before nginx (directly running php index.php
).
Any idea?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'
I just tried with PHP 5.2, and that constant seems to exists : ... But it seems there is a bug in PHP...
Read more >Drupal 7: PHP fatal error 'Undefined class constant ...
Hello, I am trying to install Drupal 7 locally, and it faiuls when I try to provide MySQL data: - the ditribution is...
Read more >Fatal error: Uncaught Error: Undefined class constant 'VERSION'
Site I was running this plugin on (crusadercaravans.com.au) threw an error this morning (after some plugin updates) of: == Fatal error: Uncaught Error: ......
Read more >Class Constants - Manual - PHP
As of PHP 8.1.0, class constants cannot be redefined by a child class if it is defined as final. ... abstract class dbObject...
Read more >Re: Undefined class constant 'XML_NODE_ALLOWED_MED...
Undefined class constant 'XML_NODE_ALLOWED_MEDIA_EXT_SWF. Hola, como estan? Escribo este post para solicitar ayuda con el siguiente error luego ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
check your php.ini for your fpm installation. Seems your missing the mysql pdo plugin there. It seems to be enabled for the cli installation and thats why its working “directly”. The /setup page should have told you if you have a supported mysql/php installation. It is flashy red when not, so you really cant miss it! .-) check this out: http://stackoverflow.com/questions/2424343/undefined-class-constant-mysql-attr-init-command-with-pdo
Ran into this issue 3 years later. Was able to figure out the issue, my mysql and php weren’t talking to each other.
apt-get update apt-get install php7.2-mysql
Fixed the issue for me.