买到一包假南京烟
十一块五浪费了
不是觉得百来块的书贵么
抽十来包烟,就能买一本,还觉得贵么?
买到一包假南京烟
十一块五浪费了
不是觉得百来块的书贵么
抽十来包烟,就能买一本,还觉得贵么?
首先下载eaccelerator最新版
wget http://sourceforge.net/projects/eaccelerator/files/eaccelerator/eAccelerator%200.9.6.1/eaccelerator-0.9.6.1.tar.bz2
网上的教程说要有/usr/local/php/bin/phpize,但是我的vps上的php是apt-get的没有怎么办?
搜索得知要安装php5-dev才会有phpize,还要安装autoconf,automake
apt-get install php5-dev autoconf automake
安装到最后提示了
update-alternatives: using /usr/bin/php-config5 to provide /usr/bin/php-config (php-config) in auto mode. update-alternatives: using /usr/bin/phpize5 to provide /usr/bin/phpize (phpize) in auto mode.
既然给了上面的提示,就用带5的
准备工作差不多了开始安装
tar jxvf eaccelerator-0.9.6.1.tar.bz2 cd eaccelerator-0.9.6.1 /usr/bin/phpize5 ./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config5 make make install
提示说 Installing shared extensions: /usr/lib/php5/20090626+lfs/
这样创建缓存目录
mkdir /tmp/eaccelerator chmod 777 /tmp/eaccelerator
这时编辑/etc/php5/fpm/php.ini在最后加入如下代码
配置项更具体准确的含义来自:https://eaccelerator.net/wiki/Settings
vim /etc/php5/fpm/php.ini
[eaccelerator] zend_extension="/usr/lib/php5/20090626+lfs/eaccelerator.so" eaccelerator.shm_size="32" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="300" eaccelerator.shm_prune_period="120" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9"
重启下php5-fpm
/etc/init.d/php5-fpm restart
如何检测呢,搞一个phpinfo();
这时进到/tmp/eaccelerator会发现有不少的目录
收获:
有空的话还是要不怕麻烦编译安装,这样对程序会更熟悉
不要从不靠谱的网上直接复制配置文件,复制过来的双引号全是中文的
续:
按wiki里面说的我查看了下最大共享大小
cat /proc/sys/kernel/shmmax
得到33554432
用expr除了两次:
expr 33554432 \/ 1024 32768 expr 32768 \/ 1024 32
而这样按配置设置64,php5-fpm就不能重启成功
比如想弄成64,则
echo 67108864 > /proc/sys/kernel/shmmax
效果如何?
不会测试,网上人说的是ea的作用就是让缓存里php文件不需要再次编译,这一点我觉得有可能吧

最近nginx要升级1.1.7,而且vps支持ipv6,并送了一个ipv6地址
正好学校里有ipv6上网环境,大致步骤是加入ipv6模块,并在nginx的配置里加入ipv6监听,使用ipv6可以直接访问
nginx的升级和加入ipv6模块
wget http://nginx.org/download/nginx-1.1.7.tar.gz tar vxzf nginx-1.1.7.tar.gz cd nginx-1.1.7 ./configure --with-ipv6 make mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old cp objs/nginx /usr/local/nginx/sbin/nginx make upgrade
测试下配置文件:/usr/local/nginx/sbin/nginx -t
查看下,已经添加了ipv6模块
root@www:~# nginx -V nginx: nginx version: nginx/1.1.7 nginx: built by gcc 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) nginx: configure arguments: --with-ipv6
nginx的配置文件
里面加入下面指令,如果是默认网站的话加default
listen [::]:80 default;
http://[2604:6600:1059::5810:3a0a]/
重新加载配置文件
kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
不要用nginx -s reload 我用了不管用
在域名提供商那里加入ipv6的AAAA记录
去 http://ipv6-test.com/ 加一张认证图过来
:)EOT
在自已的vmplayer里面装了一个oecms,但是装好后验证码始终出不来,ie下显示一个红叉,火狐下显示空白。
开始我想会不会是因为缓存和目录权限的问题
后来看了看php代码发现里面直接就是image/PNG,我一想,应该是php库没装全,于是去网上搜了一下,这个库包含了libjpeg,libpng
于是
apt-get install php5-gd
问题解决。
PHP处理图像,使用了GD库,它使php支持 gif , jpeg , ttf ,wbmp
:)EOT
If using a Debian-based Linux system, you can run the following commands:
sudo apt-get install php5-mcrypt
创建一个用户realabc,步骤为进入mysql库,向user表中插数据,本地登陆,密码abc;flush privileges 使配置生效
mysql> use mysql;
mysql> insert into user (Host,User,Password) values ("localhost","realabc",PASSWORD("abc"));
mysql> flush privileges;
其实直接使用grant命令mysql也会帮我们创建用户
grant all privileges on *.* to 'yyy'@'localhost' identified by '123';
接下来想让realabc用户来插入、更新discuzx数据库里的pre_abc、pre_def表,那么肯定是用insert,update,当然还有select,要不数据都没法看到。先查看当前用户的权根:
mysql> show grants for realabc@localhost; +----------------------------------------------------------------------------------------------------------------+ | Grants for realabc@localhost | +----------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'realabc'@'localhost' IDENTIFIED BY PASSWORD '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E' | +----------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
接下来分两步输命令,提升权根
GRANT SELECT, INSERT, UPDATE ON `discuzx`.`pre_abc` TO 'realabc'@'localhost' ; GRANT SELECT, INSERT, UPDATE ON `discuzx`.`pre_def` TO 'realabc'@'localhost' ;
如果权限加多了,可以使用revoke来回收权限,如
revoke select ON database1.* from 'yyy'@'localhost' ;
revoke ALL ON *.* from 'yyy'@'localhost' ;
如果为某数据库提升所有权限,使用
grant all on wordpress.* to wordpress@localhost;
这样查看权根,就会发现提升了,进phpmyadmin里就可以插数据了。
进了phpmyadmin发现还有一个information_schema,不想让phpmyadmin显示
找到phpmyadmin/libraries/config.default.php
在242行处加入information_schema
$cfg['Servers'][$i]['hide_db'] = 'information_schema';
Update: 2017-06-27
上述都是通过 grant 创建用户,在 mysql 5.7 会报 warning
+---------+------+------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------------------------------------------------------------------------------------------------------+ | Warning | 1287 | Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement. | +---------+------+------------------------------------------------------------------------------------------------------------------------------------+
使用指导的方式创建 reporting 库和对应权限
CREATE DATABASE `reporting` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */ create reporting@'%' identified by ''; grant all privileges on reporting.* to reporting@'%';
:)EOT