在Mac OS 10.6(Snow Leopard),10.7(Lion),10.8(Mountain Lion)上激活PHP和MySQL的最简单方法?

编程入门 行业动态 更新时间:2024-10-27 15:28:11
本文介绍了在Mac OS 10.6(Snow Leopard),10.7(Lion),10.8(Mountain Lion)上激活PHP和MySQL的最简单方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Mac OS 10.6(Snow Leopard),10.7(Lion),10.8(Mountain Lion)上激活PHP和MySQL的最简单方法是什么?

What is the easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard), 10.7 (Lion), 10.8 (Mountain Lion)?

我希望先使用任何捆绑版本,然后再从PHP或MySQL网站下载.那也排除了MAMP和类似的东西.

I'd prefer to use any bundled versions before resorting to downloading from the PHP or MySQL websites. That also rules out MAMP and similar.

我对终端中的命令行感到很舒服.

I'm comfortable at the command line in Terminal.

推荐答案

打开一个好的文本编辑器(我建议使用TextMate,但是免费的TextWrangler或vi或nano也可以这样做),然后打开:

Open a good text editor (I'd recommend TextMate, but the free TextWrangler or vi or nano will do too), and open:

/etc/apache2/httpd.conf

查找行:

"#LoadModule php5_module libexec/apache2/libphp5.so"

然后取消注释(删除#).

And uncomment it (remove the #).

从mysql下载并安装最新的MySQL版本.为Intel选择x86_64版本(除非您的Intel Mac是不是64位芯片的原始Macbook Pro或Macbook.在这种情况下,请使用32位x86版本).

Download and install the latest MySQL version from mysql. Choose the x86_64 version for Intel (unless your Intel Mac is the original Macbook Pro or Macbook, which are not 64 bit chips. In those cases, use the 32 bit x86 version).

安装所有MySQL组件.使用首选窗格,启动MySQL.

Install all the MySQL components. Using the pref pane, start MySQL.

在共享系统偏好设置中,打开(或如果已打开,则关闭/打开)Web共享.

In the Sharing System Pref, turn on (or if it was already on, turn off/on) Web Sharing.

您现在应该运行Apache/PHP/MySQL.

You should now have Apache/PHP/MySQL running.

在10.4和10.5中,必须修改php.ini文件以指向mysql.sock的正确位置.有报告说,此问题已在10.6中修复,但考虑到以下一些评论,对于我们所有人来说并非如此.

In 10.4 and 10.5 it was necessary to modify the php.ini file to point to the correct location of mysql.sock. There are reports that this is fixed in 10.6, but that doesn't appear to be the case for all of us, given some of the comments below.

更多推荐

在Mac OS 10.6(Snow Leopard),10.7(Lion),10.8(Mountain Lion)上激活PHP和MySQL的最简单方法?

本文发布于:2023-07-05 01:19:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1031299.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最简单   方法   Snow   Leopard   Mac

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!