解决apache报错:Failed to lookup provider shm for slotmem

解决apache报错:Failed to lookup provider ‘shm’ for ‘slotmem’: is mod_slotmem_shm loaded

vi httpd.conf
找到#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

(按i进入编辑模式)去掉#号
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

保存(:wq)

发表在 Apache | 标签为 , , , | 留下评论

IOS UIImageView和UIButton

UIImageView和UIButton
1> 使用场合
* UIImageView: 如果仅仅是显示图片,不需要监听图片的点击
* UIButton: 既要显示图片,又要监听图片的点击

2> 相同:能显示图片

3> 不同点
* UIButton能处理点击事件, UIImageView不能处理点击事件
* UIButton既能显示图片, 又能显示文字
* UIButton能同时显示两张图片
* UIButton继承自UIControl, 因此默认就能处理事件
* UIImageView继承自UIView, 因此默认就不能处理事件

发表在 IOS | 标签为 , , , , | 留下评论

mac finder显示路径

解决上部显示完整路径的方法:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

重启finder:
快捷键command+option+esc,在弹出的窗口中找到finder并选中,然后点击“重新启动”按钮。

如果想恢复到默认,可以把上述命令结尾的“YES”替换称“NO”再次执行即可

发表在 Mac | 标签为 , , | 留下评论

mysql授权root远程访问

1.本机登录mysql
mysql -u root -p
输入密码后登录
2.授权
mysql>GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
mysql>FLUSH   PRIVILEGES ;
mysql>exit;

3.通过其他机器连接测试

发表在 Mysql | 标签为 , , , | 留下评论

Linux普通用户源码编译安装apache和php(非root用户)

Linux普通用户源码编译安装apache和php(非root用户)

1.下载http://archive.apache.org/dist/apr/apr-1.5.1.tar.gz
2.下载http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
3.下载http://jaist.dl.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz
4.下载http://cn2.php.net/distributions/php-5.6.2.tar.gz
5.下载http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.10.tar.gz
6.下载http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
7.安装apr
./configure –prefix=/pad/local/apr
make && make install
8.安装apr-util
./configure –prefix=/pad/local/apr-util -with-apr=/pad/local/apr/bin/apr-1-config
make && make install
9.安装pcre
./configure –prefix=/pad/local/pcre
make && make install
10.安装apache
./configure –prefix=/pad/local/apache –with-apr=/pad/local/apr –with-apr-util=/pad/local/apr-util/ –with-pcre=/pad/local/pcre
make && make install
11.安装libmcrypt
./configure –prefix=/pad/local/libmcrypt
make && make install
12.安装php
./configure –prefix=/pad/local/php -with-apxs2=/pad/local/apache/bin/apxs –with-curl –with-mcrypt=/pad/local/libmcrypt –enable-mbstring –with-iconv –with-gd -with-jpeg-dir=/usr/local/lib –enable-pdo –with-pdo-mysql=mysqlnd –with-mysqli=mysqlnd –with-mysql=mysqlnd
make && make install

13.复制php.ini文件
cp /pad/soft/php-5.6.2/php.ini-production /pad/local/php/lib/php.ini

vi /pad/local/php/lib/php.ini

把include_path前面的分号删除,改成include_path=”/pad/local/php/lib/php”

14.配置apache支持解析.php后缀文件
vi /pad/local/apache/conf/httpd.conf
在最下面加入一行AddHandler application/x-httpd-php .php

15.测试
vi /pad/local/apache/htdocs/phpinfo.php
phpinfo.php的内容如下:

16.访问
http://localhost/phpinfo.php

apache启动停止命令:
启动:/pad/local/apache/bin/apachectl start
停止:/pad/local/apache/bin/apachectl stop

发表在 linux | 标签为 , , , , , , , | 留下评论