In PHP scripts that run queries to a MySQL database over a long period of time, the connection may time out and give a “MySQL server has gone away” error.
Continue reading post "Automatically reconnect PDO when connection times out"php posts page 2
Import SQL file in Doctrine / PDO
I recently needed to programmatically import SQL files containing database dumps into a database managed by Doctrine ORM.
Continue reading post "Import SQL file in Doctrine / PDO"New server setup at Cogneato
I’m kind of excited that we moved the first site onto a new server setup at Cogneato. I had worked off and on on the setup for months before we finally went forward with it. It brings a new OS, new host, new software, and a number of other changes to our previous setup.
Continue reading post "New server setup at Cogneato"Today I learned that PHP’s mkdir()
with the octal permission argument apparently doesn’t support any value other than 0
in the leftmost octal spot (where setuid, setgid, and sticky bit go).
FastCGI and “Primary Script Unknown”
If you’re routing requests for script file names through FastCGI, and don’t have some rule to catch requests for unknown scripts, you might find errors like:
Got error 'Primary script unknown\n'
in your error log.
Continue reading post "FastCGI and “Primary Script Unknown”"PHP zend_mm_heap corrupted error
We were getting errors on our server where certain pages or even sites would occasionally or frequently show errors for no apparent reason.
Continue reading post "PHP zend_mm_heap corrupted error"PHP: Fallback for old constructor style
In versions of PHP before 5, constructors were functions with the same name as their class. PHP 5 introduced the __construct()
unified name, and has deprecated the old style in PHP 7. Cogneato still has code remnants from long ago, with the old style. I recently worked on improving the compatibility of our old code with PHP 7.
HTTP 2 on Ubuntu 18.04 with Apache and PHP
I recently got h2 (HTTP 2.0) running on my server.
Continue reading post "HTTP 2 on Ubuntu 18.04 with Apache and PHP"Server upgrade: Ubuntu 18.04
I’ve finally updated my server to Ubuntu 18.04 using do-release-upgrade
.
10k Apart: Deployed
My 10k Apart entry was finally deployed and can be seen at its Azure URL, though it’s not in their gallery yet. There were problems deploying it, and it took several tries and back and forths with Aaron Gustafson himself to get it working.
Continue reading post "10k Apart: Deployed"