New York Systems

I'm David. I live in Astoria. During the day I work at a startup. Other times I visit bookstores.
This blog is my curio collection, sort of. I'll have a place of my own for essays... someday.

Posts tagged #me

Fitting room selfies.

Can’t wait for summer to be over.

Friday before a long weekend and @arc90 is empty.

PHP, MySQL, and localhost

This bedeviled me today for a while, so I figured I’d share it here.

PHP will attempt to connect with a local socket instead of using TCP when ‘localhost’ is specified as the hostname, and this can have unpredictable results. Wordpress, for example, on a Mac, completely failed to connect to the database, even though phpMyAdmin, for example, with the same hostname, connected just fine, and manually cURLing localhost:3306 gave me back the expected “Got packets out of order” failure-blob, so I knew the server was up and on the usual port.

This is apparently solvable three ways. One: use 127.0.0.1 as your hostname, instead of localhost, because using the IP forces PHP to use TCP. You can also try and make sure that PHP’s settings look for the socket at the right place — /tmp/mysql.sock instead of the default /var/mysql/mysql.sock. The most fragile way is to symlink those two locations to each other.

I switched to specifying my local loopback IP and everything’s hunky-dory.

places and people

A picture of me reading aloud from The Haunted Bookshop on the Morley Walk this weekend. I read in front of Terrace Books (previously Babbo’s Books). My part was a section devoted to a bunch of booksellers arguing about what they owe the reading public:

Mɪғғʟɪɴ—Not at all. I am simply saying that it is good business to sell only the best.
Gʟᴀᴅғɪsᴛ—Wrong again. You must select your stock according to your customers.

Picture credit: Wah-Ming Chang, Melville House. Thanks!

Acquired texts August 2013

Summer Streets and surroundings, 8/17/13

Office selfies. New glasses!