[Wed Nov 21 07:25:58.290266 2018] [:error] [pid 18334] [client XXXXXXXXXXXXXX] SQLSTATE[HY000] [2002] No such file or directory [/var/app/current/lib/db/sql.php:505] [Wed Nov 21 07:25:58.290315 2018] [:error] [pid 18334] [client XXXXXXXXXXXXXX] [lib/db/sql.php:505] PDO->__construct()
[Wed Nov 21 07:25:58.290320 2018] [:error] [pid 18334] [client XXXXXXXXXXXXXX] [classes/Controller.php:133] DB\\SQL->__construct()
[Wed Nov 21 07:25:58.290322 2018] [:error] [pid 18334] [client XXXXXXXXXXXXXX] [index.php:43] Base->run()
And controller.php:133 snip looks like:
$f3->set('DB', new \DB\SQL( 'mysql:host='.$f3->get('DBHOST').';port='.$f3->get('DBPORT').';dbname='.$f3->get('DBNAME'), $f3->get('DBUSER'), $f3->get('DBPASS'), array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION) ));
The vars DBHOST, DBPORT, etc... are coming from /config/config.ini file and work without issue 99% of the time.
It seems as though something is trying to instantiate a PDO object with no params. This is much more noticeable overnight when traffic is very low, so the alarm trips due to the percentage of failed requests.
Currently running F3 version 3.6.1
If anyone has any insight it would be greatly appreciated. Thank you!
--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To post to this group, send email to f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/3bf7a92e-087b-4df0-8c27-03e6de30125a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It just happen to me on a mac,
For the record, it's macOS 10.15.4 aka macOS Catalina
# Order allow,deny
# Allow from All
Require all granted
you need to add "Require all granted", but back to the point, I got the same
SQLSTATE[HY000] [2002] No such file or directory [/var/app/current/lib/db/sql.php
Then I created a different php file to test the PDO connection and same issue, so it was not F3.
Started reading and somebody ran "php -i | grep sock" ( same response as phpinfo() ). The mysql.sock file create by default is in "/tmp/mysql.sock" but the PHP is looking at "/var/mysql/mysql.sock" so, because I couldn't find "my.cnf" then..
I created "/var/mysql" directory and soft linked to the "/tmp/mysql.sock".
Ran the little script again, It worked!,
Reloaded my index.php and it worked on F3!.
For some reason, my PHP default installation on my mac does not have a php.ini, and the mysql default does not have my.cnf file. weird!
It's not a F3 problem, is a mysql-php problem. Thought it was ok to share with you guys.
Antonio