WebFaction
Community site: login faq

I'm trying to get all of my stuff off of shared WF servers and onto my own servers for full control.

I'm running a personal MySQL server from the app deployment menu. I'm running nginx and PHP-FPM compiled from source listening on a custom port.

I got Xenforo uploaded but it can't validate my database settings. It returns "No such file or directory" when I try to submit my database info. I have the MySQL server set to localhost and I entered the port that my dashboard reports my MySQL server application is running on.

I have PHP compiled with --with-mysql-sock=$HOME/webapps/mysql/var/mysql.sock which is where the mysql.sock file for my personal server is located. I've confirmed that the mysqld process is running under my user account.

What should I try next?

asked 19 Aug '13, 15:45

HittingSmoke
4822230
accept rate: 8%


Look for a socket path configuration at the application level and set it. If the application itself does not provide it look lower at the code which connects to MySQL.

permanent link

answered 19 Aug '13, 16:58

johns
5.4k312
accept rate: 23%

Thanks. That did it. Didn't realize MySQL treats localhost and 127.0.0.1 differently. I thought it was a server problem, not the app.

Although instead of using TCP with the full localhost address I found a hack to use a socket to reduce overhead.

Just had to add ini_set('mysqli.default_socket', '/path/to/mysql.sock'); in the config file.

(19 Aug '13, 22:33) HittingSmoke

Turns out a more elegant solution is to just add mysqli.default_socket = "/path/to/mysql.sock" to php.ini.

(23 Aug '13, 19:53) HittingSmoke

For posterity:

A better solution to this was to add mysqli.default_socket = "/path/to/mysql.sock" in php.ini.

When PHP is configured in this way any instance of localhost in a MySQL server field will connect through the socket you've set in php.ini instead of the server default. This will get around PHP scripts that don't support custom sockets out of the box while still removing the TCP overhead from the database connection.

permanent link

answered 23 Aug '13, 19:52

HittingSmoke
4822230
accept rate: 8%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×168

question asked: 19 Aug '13, 15:45

question was seen: 17,500 times

last updated: 23 Aug '13, 19:53

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM