bionhosts.blogg.se

Php mysql for mac
Php mysql for mac









  1. #Php mysql for mac how to
  2. #Php mysql for mac mac os x
  3. #Php mysql for mac install
  4. #Php mysql for mac update

AllowOverride All Options Indexes MultiViews FollowSymLinks Require all granted

php mysql for mac

Open Apache folder and create nf in the /users directory: cd /etc/apache2/users sudo nano nfĪdd the text below in nf and save it ( CTRL+ O). If this article helped you, please click the Tweet or +1 buttons.Create /Sites folder in username: sudo mkdir ~/Sites If you have any questions or comments about the process above, please leave a comment.

php mysql for mac

#Php mysql for mac how to

Happy days! PHP could talk to MySQL, and my WordPress site was working on OSX Lion.īy the way, if you need mycrypt working with PHP on Lion, Michael Gracie‘s written an excellent post on how to do this. I needed to restart Apache for it to pickup the new configuration: tazair:~ taz$ sudo apachectl restart WordPress perhaps only needed one of three MySQL extensions: tazair:~ taz$ grep mysql /etc/php.ini|grep ext I also enabled two of the three MySQL extensions, which were configured off in the default php.ini in the Lion install. fault_socket = /var/mysql/mysql.sockĪfter editing php.ini: tazair:~ taz$ grep. Before editing php.ini: tazair:~ taz$ grep.

#Php mysql for mac update

I edited the new PHP configuration to update all references to /var/mysql/mysql.sock to /tmp/mysql.sock. I copied the example PHP configuration into place: sudo cp /etc/ /etc/php.ini It makes sense to do this: Lion uses PHP 5.3 which has new options and defaults, compared to PHP 5.2 used on Snow Leopard. Lion renamed my php.ini file to /etc/php.ini-5.2-previous, and put a new sample PHP configuration file, /etc/.

#Php mysql for mac install

connecting to MySQL) was OS X Lion install had moved my PHP configuration file – php.ini – out of the way: tazair:smartwebdeveloper taz$ ls -l /etc/php* The reason why PHP wasn’t working properly (i.e. I checked the PHP configuration directory /etc/php. I went to that webpage through the web and found, sure enough that all three PHP MySQL extensions – MySQL, MySQLi and PDO MySQL were all expecting the MySQL socket to be in /var/mysql. I created a quick PHP file calling the phpinfo() function in my website’s home directory to check the PHP configuration:

#Php mysql for mac mac os x

I remembered that Mac OS X Server’s MySQL install puts the socket for communicating with MySQL at /var/mysql/mysql.sock. Happily it had left my configuration that enabled the PHP 5 module in place. It put a new in place in case I Apache wanted to use an more up to date Apache configuration. The Lion upgrade process left my Apache config alone, so my virtual host was still intact and working. In /Users/taz/Sites/smartwebdeveloper/wp-includes/wp-db.php (trying to connect via unix:///var/mysql/mysql.sock) It turns out WordPress / PHP could not connect to the MySQL database on my Mac running Lion: Warning: mysql_connect() : In WordPress’s wp-config.php file, I set the WP_DEBUG constant to true to see what is going on: define('WP_DEBUG', true) Lion ships with PHP 5.3.6, the latest production release of PHP. It’s a WordPress site, using both PHP and MySQL. I’d just get an empty webpage when I went to the website.

php mysql for mac

After installing Mac OS X Lion, I found the PHP site I use for development stopped working.











Php mysql for mac