##mac部署memadminphp
注意:html
TODO:git
###配置apache,启用php模块apache
1. 编辑/etc/apache2/httpd.conf,找到 “#LoadModule php5_module libexec/apache2/libphp5.so” 去掉注视,保存而且退出。 2. 终端运行 “sudo cp /etc/php.ini.default /etc/php.ini” 3. 运行“sudo apachectl restart”,重启Apache,这样PHP就能够用了。 运行“cp /Library/WebServer/Documents/index.html.en /Library/WebServer/Documents/info.php”,即在Apache的根目录下复制index.html.en文件并重命 名为info.php 在终端中运行“vi /Library/WebServer/Document/info.php”,这样就能够在vi中编辑info.php文件了。在“It’s works!”后面加上“<?php phpinfo(); ?>”,而后保存之。这样就能够在http://localhost/info.php中看到有关PHP的信息,好比版本号是5.3.1。
###安装php memcached扩展浏览器
mac os lion 系统默认安装了apache和php,若是要在php中使用memcached,就须要本身安装扩展。本文采用源码方式来安装。php扩展有两种,一个是memcache,一个是memcached,下载地址为:curl
memcache:http://pecl.php.net/package/memcache memcached:http://pecl.php.net/package/memcached
安装memcached,就须要安装先libmemcached,这里安装的是memcache。memcached
在上述连接中选择下载一个源码,例如:memcache-2.2.6.tgz,解压并进入解压目录,先执行phpize,本人系统出现以下错误:this
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
缘由是系统没有安装autoconf,解决办法:url
从MacPorts中安装autoconf sudo port install autoconf
安装好autoconf,下面就能够开始安装memcache扩展了,安装命令以下:
cd ~ mkdir tmp cd tmp curl http://pecl.php.net/get/memcache-2.2.6.tgz -o memcache-2.2.6.tgz tar -xvf memcache-2.2.6.tgz cd memcache-2.2.6 sudo phpize sudo ./configure sudo make sudo make install
若是看到相似以下输出:
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20090626/
表示编译成功。最后还须要修改php.ini,把以下信息添加进去:
extension=memcache.so
至此,php memcache扩展就编译安装成了,重启apache服务,就能够在php中使用memcache。
###部署MemAdmin
官网下载MemAdmin,解压,而后将解压后的目录移至/Library(资源库)/WebServer/Documents/
下,这是 Apache 默认跟目录
重启apache,浏览器访问http://localhost/memadmin/index.php
便可