安装PostGresQL&在Mac OS X中运行MySQL的MySQL? [英] Installing PostGresQL & MySQL in Mac OS X running MAMP?

查看:59
本文介绍了安装PostGresQL&在Mac OS X中运行MySQL的MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我在Mac OS X上安装了MAMP,并且已经启动并运行了PostGres,但是想知道如何在PHP中使用它吗?我假设在编译PHP时需要做些事,以便它可以同时使用两者,但是,如果安装了PHP,我不确定该怎么做?或者,如果需要做一些独特的事情才能使其在MAMP环境中的Mac上运行?我真的不熟悉安装等,因此非常感谢帮助/指导/链接等.我一直在搜寻,但想想也许我甚至都没有在寻找合适的词...

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...

推荐答案

首先,您应该使用包含以下内容的PHP脚本

First of all, you should use a PHP script containing

<?php
phpinfo();

这将向您显示已安装/启用了哪些PHP扩展.

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

幸运的是,您已经安装了mysql/mysqli/pdo_mysqlpgsql/pdo_pgsql,这意味着从PHP方面可以:只需使用正确的函数/类来连接到pg和/或MySQL服务器.

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.

这篇关于安装PostGresQL&amp;在Mac OS X中运行MySQL的MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆