Environment Consistency – PHP/MySQL Configuration (Apple Macintosh)
We need to make our life easier by creating consistency for every machine. What this means is every machine you try to use, whether it be yours or your colleagues, the environment will be the same when you sit down to help them with something. This is very important if you’re a Development Manager and you’re trying to help one of your staff.
This is one of several posts in regards to this subject.
We’ve installed PHP and MySQL but we haven’t “connected” the two of them. We’re going to do that today and it’s actually pretty easy to do. All we have to do is tell PHP where the MySQL socket file is located. The PHP we installed, thinks it is going to be at “/var/mysql/mysql.sock”. However, on our Apple Macintosh it isn’t located there. It’s located at “/tmp/mysql.sock”. All we have to do is start up a “Terminal” session and edit our “php.ini” file using “sudo” like so:
and we then find the line that starts “mysql.default_socket” like so (it’s highlighted):
and change it from “/var/mysql/mysql.sock” to “/tmp/mysql.sock” like so (again highlighted):
now we have another line that starts “pdo_mysql.default_socket” that we also need to change. We’re changing it in the same way. From “/var/mysql/mysql.sock” to “/tmp/mysql.sock”. Here are two screen shots of the before and after:
save it and you’re done!
Reboot to make sure everything gets re-initialized. This may be unnecessary but what’s it hurt?
Next week, I’ll show you how to verify that you’re talking to the database.
No comments yet.
Leave a Reply
-
Recent
- HSQLDB – What a piece of …..
- Environment Consistency – Apache HTTP Server (Windows)
- Environment Consistency – MySQL (Windows)
- MAMP
- Environment Consistency – Verify PHP to MySQL Connectivity (Apple Macintosh)
- Environment Consistency – PHP/MySQL Configuration (Apple Macintosh)
- Environment Consistency – MySQL (Apple Macintosh)
- Environment Consistency – PHP (Apple Macintosh)
- Environment Consistency – Sync Directories
- Environment Consistency – Directories (Windows)
- Environment Consistency – Directories (Apple Mac)
- Environment Consistency – NetBeans (Windows)
-
Links
-
Archives
- June 2010 (1)
- January 2010 (1)
- December 2009 (4)
- November 2009 (5)
- October 2009 (5)
- September 2009 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS




