Installing PostGresQL & MySQL in Mac OS X running MAMP?

百般思念 提交于 2019-12-11 14:49:52

问题


Well, I have MAMP installed on my Mac OS X, and I've got PostGres up and running, but am wondering how I can use it with PHP? I'm assuming that there's something I need to do where I compile PHP so that it can use both, but, I'm not sure how to do that if PHP has already been installed? Or, if there's something unique I need to do to get it work on the Mac in a MAMP environment? I'm really unfamiliar with installations ,etc., so, help / direction / links, etc., is greatly appreciated. I've been googling, but think maybe I'm not even searching for the right terms...


回答1:


First of all, you should use a PHP script containing

<?php
phpinfo();

This will show you which PHP extensions are installed / enabled.

With a bit of luck, you'll have mysql/mysqli/pdo_mysql and pgsql/pdo_pgsql already installed -- which means it'll be OK from the PHP side : you'll just have to use the right functions/classes to connect to your pg and/or MySQL servers.




回答2:


You need the php postgres driver, you can try macports to install the php5-pgsql extension



来源:https://stackoverflow.com/questions/2029566/installing-postgresql-mysql-in-mac-os-x-running-mamp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!