<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>RSS - Joker</title>
    <description>Joker - Yesterday you said tomorrow.</description>
    <link>http://zhangyumin.github.io</link>
    <atom:link href="http://zhangyumin.github.io/page/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Fri, 10 Jul 2020 02:09:38 +0000</pubDate>
    <lastBuildDate>Fri, 10 Jul 2020 02:09:38 +0000</lastBuildDate>
    <generator>zhangyumin</generator>
    
      <item>
        <title>Model validation must implement interface Phalcon\ValidationInterface</title>
        <description>&lt;p&gt;给新的线上服务器装phalcon3.0，在Model validation这里就报错了，想必是升级后一部分不向下兼容了，查了查更新log，果然有这部分代码更换了。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Catchable fatal error: Argument 1 passed to Phalcon\Mvc\Model::validate() must implement interface Phalcon\ValidationInterface, instance of Phalcon\Mvc\Model\Validator\Email given in C:\xampp\htdocs\invo\app\models\Users.php on line 13
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;!-- more --&gt;
&lt;p&gt;引用官网blog:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Phalcon\Mvc\Model\Validation is now deprecated in favor of Phalcon\Validation. The functionality of both components is merged into one, allowing us to reduce the codebase while offering the same functionality as before.
Previously validations were implemented as follows:

namespace Invo\Models;

use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Validator\Email as EmailValidator;
use Phalcon\Mvc\Model\Validator\Uniqueness as UniquenessValidator;

class Users extends Model
{
    public function validation()
    {
	$this-&amp;gt;validate(
	    new EmailValidator(
	        [
	            'field' =&amp;gt; 'email',
	        ]
	    )
	);

	$this-&amp;gt;validate(
	    new UniquenessValidator(
	        [
	            'field'   =&amp;gt; 'username',
	            'message' =&amp;gt; 'Sorry, That username is already taken',
	        ]
	    )
	);

	if ($this-&amp;gt;validationHasFailed() == true) {
	    return false;
	}
    }
}


Introducing Phalcon\Validation, you will need to change the above to:

namespace Invo\Models;

use Phalcon\Mvc\Model;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Email as EmailValidator;
use Phalcon\Validation\Validator\Uniqueness as UniquenessValidator;

class Users extends Model
{
    public function validation()
    {
	$validator = new Validation();

	$validator-&amp;gt;add(
	    'email', //your field name
	    new EmailValidator([
	        'model' =&amp;gt; $this,
	        &quot;message&quot; =&amp;gt; 'Please enter a correct email address'
	    ])
	);

	$validator-&amp;gt;add(
	    'username',
	    new UniquenessValidator([
	        'model' =&amp;gt; $this,
	        'message' =&amp;gt; 'Sorry, That username is already taken',
	    ])
	);

	return $this-&amp;gt;validate($validator);
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;已经不支持以前的那种validation方式了，validator的位置变了，添加validation方式也变成了先创建一个validation对象，然后调用add方法来添加需要验证的字段。&lt;/p&gt;
</description>
        <pubDate>Sun, 24 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/07/24/model-validation-must-implement-interface-phalcon-validation-interface.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/07/24/model-validation-must-implement-interface-phalcon-validation-interface.html</guid>
        
        <category>战Error</category>
        
      </item>
    
      <item>
        <title>Phalcon &quot;undefined symbol:php_pdo_get_dbh_ce in Unknown on line 0&quot;</title>
        <description>&lt;p&gt;按照官网的步骤安装phalcon，一切都顺利，php_info()也能打印出phalcon.so相关的信息。&lt;/p&gt;

&lt;p&gt;可就是一直在不停的报错：undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0”
&lt;!-- more --&gt;&lt;/p&gt;

&lt;p&gt;很多人都碰见过这样的问题，原因是pdo在phalcon之后加载了，这样phalcon就没法调用php_pdo_get_dbh_ce了。&lt;/p&gt;

&lt;p&gt;解决方法是将/etc/php/5.6/cli/conf.d/30-phalcon.ini中的那个数字权重改的比pdo大，这样就能保证pdo在phalcon之前加载了。&lt;/p&gt;

&lt;p&gt;大部分人改完就OK了，但是实际上extension=phalcon.so是不应该被写到php.ini中的，而只是在/etc/php/5.6/cli/conf.d/30-phalcon.ini中。&lt;/p&gt;

&lt;p&gt;所以将php.ini中的extension=phalcon.so注释掉，然后重启apache就可以了。&lt;/p&gt;
</description>
        <pubDate>Sun, 24 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/07/24/undefined-symbol-php_pdo_get_dbh_ce-in-phalcon.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/07/24/undefined-symbol-php_pdo_get_dbh_ce-in-phalcon.html</guid>
        
        <category>战Error</category>
        
      </item>
    
      <item>
        <title>Fatal error:Allowed memory size of unknown bytes exhausted (tried to allocate 32 bytes) in unknown.php on line unknown</title>
        <description>&lt;p&gt;上一次碰到这个问题还是刚开始学PHP的时候，果断的在php.ini中把memory_limit改大，重启apache再试，仍然报错。&lt;/p&gt;

&lt;p&gt;立马换第二方案，程序中声明ini_set(‘memory_limit’, ‘2560M’)，重启apache还是挂。&lt;/p&gt;

&lt;p&gt;再后来我仔细的盯着三行报错信息看了好几遍，终于发现是mysql这里出问题了。
&lt;!-- more --&gt;&lt;/p&gt;

&lt;p&gt;刚装的系统理论上基本都是参数有问题，可是为什么mysql会占用这么大的内存。&lt;/p&gt;

&lt;p&gt;查到的原因如下：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PHP MySQL查询(mysqli,pdo_mysql)默认使用缓冲模式.
也就是说查询结果将一次性从MySQL传输到PHP进程内存中,
这时可以统计结果集的行数,以及移动结果集指针.
缓冲模式下,如果结果集很大,那么PHP进程也会占用大量的内存,
直到结果集被unset或者free.
store_result也用于缓冲模式,所有结果一次性存储到PHP进程中:
mysqli::store_result
mysqli_stmt::store_result
如果PHP的MySQL数据库驱动底层用的是libmysqlclient,那么memory_limit不能统计到结果集占用的内存,
除非结果集已经赋值给PHP变量,如果底层使用mysqlnd作为驱动时则可以统计到(PHP从5.4开始默认底层默认使用mysqlnd).
无缓冲模式下执行的查询将会返回一个resource资源引用,位于MySQL查询结果等待PHP获取.
无缓冲模式下,PHP进程占用的内存很少,但会增大MySQL服务器的负载.
在PHP取回所有结果前,在当前数据库连接下不能发送其他的查询请求.
无缓冲查询简称use_result.
总结:
当结果集不大时,或者需要在读取所有行前获取结果集行数时,使用缓冲查询(默认).
当结果集很大时,使用无缓冲查询,避免PHP进程占用大量的内存.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;解决方法很简单，将 PDO::MYSQL_ATTR_USE_BUFFERED_QUERY 置为false就可以了，比如：&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-php&quot; data-lang=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
	&lt;span class=&quot;nv&quot;&gt;$pdo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PDO&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'mysql:host=127.0.0.1'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'foo'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'bar'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;PDO&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ATTR_ERRMODE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PDO&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ERRMODE_EXCEPTION&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
	&lt;span class=&quot;nv&quot;&gt;$pdo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PDO&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;MYSQL_ATTR_USE_BUFFERED_QUERY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;当然对于Mysql，你也可以使用mysql_unbuffered_query()来代替mysql_query()&lt;/p&gt;
</description>
        <pubDate>Tue, 12 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/07/12/php-memory-exhausted-by-mysql.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/07/12/php-memory-exhausted-by-mysql.html</guid>
        
        <category>战Error</category>
        
      </item>
    
      <item>
        <title>MySQL中自增主键不连续的问题</title>
        <description>&lt;p&gt;自增长是一个很常见的数据属性，在MySQL中大家都很愿意让自增长属性的字段当一个主键。特别是InnoDB，因为InnoDB的聚集索引的特性，使用自增长属性的字段当主键性能更好，这里要说明下自增主键需要注意的几个事项。&lt;/p&gt;

&lt;!-- more --&gt;

&lt;p&gt;&lt;em&gt;问题一：表锁&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;在MySQL5.1.22之前，InnoDB自增值是通过其本身的自增长计数器来获取值，该实现方式是通过表锁机制来完成的（AUTO-INC LOCKING）。锁不是在每次事务完成后释放，而是在完成对自增长值插入的SQL语句后释放，要等待其释放才能进行后续操作。比如说当表里有一个auto_increment字段的时候，innoDB会在内存里保存一个计数器用来记录auto_increment的值，当插入一个新行数据时，就会用一个表锁来锁住这个计数器，直到插入结束。如果大量的并发插入，表锁会引起SQL堵塞。&lt;/p&gt;

&lt;p&gt;在5.1.22之后，InnoDB为了解决自增主键锁表的问题，引入了参数innodb_autoinc_lock_mode，该实现方式是通过轻量级互斥量的增长机制完成的。它是专门用来在使用auto_increment的情况下调整锁策略的，目前有三种选择：&lt;/p&gt;

&lt;p&gt;插入类型说明：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;INSERT-LIKE：指所有的插入语句，比如 INSERT、REPLACE、INSERT…SELECT、REPLACE…SELECT,LOAD DATA等
Simple inserts：指在插入前就能确定插入行数的语句，包括INSERT、REPLACE，不包含INSERT…ON DUPLICATE KEY UPDATE这类语句。
Bulk inserts：指在插入前不能确定得到插入行的语句。如INSERT…SELECT,REPLACE…SELECT,LOAD DATA.
Mixed-mode inserts:指其中一部分是自增长的，有一部分是确定的。
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;0：通过表锁的方式进行，也就是所有类型的insert都用AUTO-inc locking。&lt;/p&gt;

&lt;p&gt;1：默认值，对于simple insert 自增长值的产生使用互斥量对内存中的计数器进行累加操作，对于bulk insert 则还是使用表锁的方式进行。&lt;/p&gt;

&lt;p&gt;2：对所有的insert-like 自增长值的产生使用互斥量机制完成，性能最高，并发插入可能导致自增值不连续，可能会导致Statement 的 Replication 出现不一致，使用该模式，需要用 Row Replication的模式。&lt;/p&gt;

&lt;p&gt;在mysql5.1.22之前，mysql的INSERT-LIKE语句会在执行整个语句的过程中使用一个AUTO-INC锁将表锁住，直到整个语句结束（而不是事务结束）。因此在使用INSERT…SELECT、INSERT…values(…),values(…)时，LOAD DATA等耗费时间较长的操作时，会将整个表锁住，而阻塞其他的insert-like,update等语句。推荐使用程序将这些语句分成多条语句，一一插入，减少单一时间的锁表时间。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;解决：&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;通过参数innodb_autoinc_lock_mode =1/2解决，并用simple inserts 模式插入。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;问题二：自增主键不连续&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;5.1.22后 默认：innodb_autoinc_lock_mode = 1 
直接通过分析语句，获得要插入的数量，然后一次性分配足够的auto_increment id，只会将整个分配的过程锁住。&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-mysql&quot; data-lang=&quot;mysql&quot;&gt;root@localhost : test 04:23:28&amp;gt;show variables like 'innodb_autoinc_lock_mode';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| innodb_autoinc_lock_mode | 1     |
+--------------------------+-------+
1 row in set (0.00 sec)

root@localhost : test 04:23:31&amp;gt;create table tmp_auto_inc(id int auto_increment primary key,talkid int)engine = innodb default charset gbk;
Query OK, 0 rows affected (0.16 sec)

root@localhost : test 04:23:35&amp;gt;insert into tmp_auto_inc(talkid) select talkId from talk_dialog limit 10;
Query OK, 10 rows affected (0.00 sec)
Records: 10  Duplicates: 0  Warnings: 0

root@localhost : test 04:23:39&amp;gt;show create table tmp_auto_inc\G;
*************************** 1. row ***************************
       Table: tmp_auto_inc
Create Table: CREATE TABLE `tmp_auto_inc` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `talkid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=gbk
1 row in set (0.00 sec)&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;插入10条记录，但表的AUTO_INCREMENT=16，再插入一条的时候，表的自增id已经是不连续了。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;原因：&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;参数innodb_autoinc_lock_mode = 1时，每次会“预申请”多余的id(handler.cc:compute_next_insert_id)，而insert执行完成后，会特别将这些预留的id空出，就是特意将预申请后的当前最大id回写到表中(dict0dict.c:dict_table_autoinc_update_if_greater)。&lt;/p&gt;

&lt;p&gt;这个预留的策略是“不够时多申请几个”， 实际执行中是分步申请。至于申请几个，是由当时“已经插入了几条数据N”决定的。当auto_increment_offset＝1时，预申请的个数是 N-1。&lt;/p&gt;

&lt;p&gt;所以会发现：插入只有1行时，你看不到这个现象，并不预申请。而当有N&amp;gt;1行时，则需要。多申请的数目为N-1，因此执行后的自增值为：1+N+(N-1)。测试中为10行，则：1+10+9 =20，和 16不一致？原因是：当插入8行的时候，表的AUTO_INCREMENT已经是16了，所以插入10行时，id已经在第8行时预留了，所以直接使用，自增值仍为16。所以当插入8行的时候，多申请了7个id，即：9，10，11，12，13，14，15。按照例子中的方法插入8~15行，表的AUTO_INCREMENT始终是16&lt;/p&gt;

&lt;p&gt;&lt;em&gt;验证：&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;插入16行：猜测 预申请的id：1+16+（16-1）= 32，即：AUTO_INCREMENT=32&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-mysql&quot; data-lang=&quot;mysql&quot;&gt;root@localhost : test 04:55:45&amp;gt;create table tmp_auto_inc(id int auto_increment primary key,talkid int)engine = innodb default charset gbk;
Query OK, 0 rows affected (0.17 sec)

root@localhost : test 04:55:48&amp;gt;insert into tmp_auto_inc(talkid) select talkId from sns_talk_dialog limit 16;
Query OK, 16 rows affected (0.00 sec)
Records: 16  Duplicates: 0  Warnings: 0

root@localhost : test 04:55:50&amp;gt;show create table tmp_auto_inc\G;
*************************** 1. row ***************************
       Table: tmp_auto_inc
Create Table: CREATE TABLE `tmp_auto_inc` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `talkid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=gbk
1 row in set (0.00 sec)&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;和猜测的一样，自增id到了32。所以当插入16行的时候，多申请了17,18,19…,31 。&lt;/p&gt;

&lt;p&gt;所以导致ID不连续的原因是因为innodb_autoinc_lock_mode = 1时，会多申请id。好处是：一次性分配足够的auto_increment id，只会将整个分配的过程锁住。&lt;/p&gt;

&lt;p&gt;5.1.22前 默认：innodb_autoinc_lock_mode = 0&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-mysql&quot; data-lang=&quot;mysql&quot;&gt;root@localhost : test 04:25:12&amp;gt;show variables like 'innodb_autoinc_lock_mode';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| innodb_autoinc_lock_mode | 0     |
+--------------------------+-------+
1 row in set (0.00 sec)

root@localhost : test 04:25:15&amp;gt;create table tmp_auto_inc(id int auto_increment primary key,talkid int)engine = innodb default charset gbk;
Query OK, 0 rows affected (0.17 sec)

root@localhost : test 04:25:17&amp;gt;insert into tmp_auto_inc(talkid) select talkId from talk_dialog limit 10;
Query OK, 10 rows affected (0.00 sec)
Records: 10  Duplicates: 0  Warnings: 0

root@localhost : test 04:25:21&amp;gt;show create table tmp_auto_inc\G;
*************************** 1. row ***************************
       Table: tmp_auto_inc
Create Table: CREATE TABLE `tmp_auto_inc` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `talkid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=gbk
1 row in set (0.00 sec)&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;插入10条记录，但表的AUTO_INCREMENT=11，再插入一条的时候，表的自增id还是连续的。&lt;/p&gt;

&lt;p&gt;innodb_autoinc_lock_mode = 2 和 innodb_autoinc_lock_mode = 1 的测试情况一样。但该模式下是来一个分配一个，而不会锁表，只会锁住分配id的过程，和1的区别在于，不会预分配多个，这种方式并发性最高。但是在replication中当binlog_format为statement-based时存在问题&lt;/p&gt;

&lt;p&gt;&lt;em&gt;解决：&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;尽量让主键ID没有业务意义，或则使用simple inserts模式插入。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;结论：&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;当innodb_autoinc_lock_mode为0时候， 自增id都会连续，但是会出现表锁的情况，解决该问题可以把innodb_autoinc_lock_mode 设置为1，甚至是2。会提高性能，但是会在一定的条件下导致自增id不连续。&lt;/p&gt;

&lt;p&gt;&lt;em&gt;总结：&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;通过上面2个问题的说明，自增主键会产生表锁，从而引发问题；自增主键有业务意义，不连续的主键导致主从主键不一致到出现问题。对于simple inserts 的插入类型，上面的问题都不会出现。对于Bulk inserts的插入类型，会出现上述的问题。&lt;/p&gt;
</description>
        <pubDate>Mon, 11 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/07/11/mysql-auto-increment-fields-not-continuous.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/07/11/mysql-auto-increment-fields-not-continuous.html</guid>
        
        <category>转载</category>
        
      </item>
    
      <item>
        <title>解决wineQQ中无法使用搜狗输入法(fcitx)的问题</title>
        <description>&lt;p&gt;昨天装好QQ后无法输入中文，用复制粘贴跟人聊天，在wineQQ下根本就打不开fcitx输入法，搜狗必然是不能用的。&lt;/p&gt;

&lt;p&gt;但是在终端中打开的QQ却意外可以输入中文，一度令我很是费解，查到是环境变量有几个没设置好，开始动手解决。&lt;/p&gt;

&lt;!-- more --&gt;

&lt;p&gt;找到wineQQ的安装目录，桌面图标点右键属性就能看到，或者用命令行搜索。&lt;/p&gt;

&lt;p&gt;我的是/opt/longene/qq/qq.sh，直接使用vim打开，可以看到里面的运行参数。&lt;/p&gt;

&lt;p&gt;将下面语句加在开始的位置，使启动qq的时候能够自动加载这些参数就可以了。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;export XMODIFIERS=&quot;@im=fcitx&quot;
export GTK_IM_MODULE=&quot;fcitx&quot;
export QT_IM_MODULE=&quot;fcitx&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;OK保存关闭，重新打开QQ测试一下吧，应该是可以愉快的输入中文了。还有一种方法是跟之前解决sublime无法输入中文方式一样，在.desktop中直接加入这些参数，效果应该是一样的。&lt;/p&gt;
</description>
        <pubDate>Sun, 10 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/07/10/fix-fcitx-input-bug-in-qq.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/07/10/fix-fcitx-input-bug-in-qq.html</guid>
        
        <category>战Error</category>
        
      </item>
    
      <item>
        <title>ubuntu16.04安装qq并解决缺少libncurses5-dev的问题</title>
        <description>&lt;p&gt;用ubuntu系统也有好几年了，QQ一直都没找到很好的解决方法，网页版的QQ能收到消息，但是传文件又不行，用网盘就更加繁琐了，装上wineQQ后，终于整个世界都清净了。&lt;/p&gt;

&lt;p&gt;用的是 longene-wine-qq，15年底最后更新，大部分功能都能正常使用，但是还是有以下的问题，不过已经很不错了：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;无法保存密码、自动登录&lt;/li&gt;
  &lt;li&gt;点击密码输入框有时不能激活，需要多点击几次&lt;/li&gt;
  &lt;li&gt;程序内选择离线后无法再次上线，需要关闭程序，重新启动&lt;/li&gt;
  &lt;li&gt;其他很多很多没有测试到的问题&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- more --&gt;

&lt;h1 id=&quot;安装longene-wine-qq&quot;&gt;安装longene-wine-qq&lt;/h1&gt;

&lt;p&gt;Wine QQ 7.8&lt;/p&gt;

&lt;p&gt;下载地址：&lt;a href=&quot;http://www.longene.org/download/WineQQ7.8-20151109-Longene.deb&quot;&gt;WineQQ7.8-20151109-Longene&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;百度网盘：&lt;a href=&quot;http://pan.baidu.com/s/1kTu9ZUZ&quot;&gt;WineQQ7.8-20151109-Longene&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;下载下来以后直接使用dpkg -i WineQQ7.8-20151109-Longene.deb安装即可。&lt;/p&gt;

&lt;p&gt;安装完成后第一次运行建议在终端中直接执行qq，看输出是否报错。&lt;/p&gt;

&lt;p&gt;#解决缺少libncurses5-dev的问题&lt;/p&gt;

&lt;p&gt;果不其然还是报错了，错误信息是这样的：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Wine cannot find the ncurses library (libncurses.so.5)
Application tried to create a window, but no driver could be loaded.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;很明显是缺少依赖了，我搜了一下系统中是有libncurses.so.5的，再回去看看说明，原来这个wineQQ支持的是32位系统&lt;/p&gt;

&lt;p&gt;而新装的64位ubuntu16.04很明显缺少32位的依赖，执行下面安装就可以了&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install  lib32ncurses5-dev 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sat, 09 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/07/09/install-qq-on-ubuntu16.04-and-fix-lack-of-libncurses.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/07/09/install-qq-on-ubuntu16.04-and-fix-lack-of-libncurses.html</guid>
        
        <category>战Error</category>
        
      </item>
    
      <item>
        <title>ubuntu16.04安装rCurl及rJava包失败的解决方案</title>
        <description>&lt;p&gt;安装R包总是会出现很多问题，不是因为版本太旧，就是系统缺少依赖，安装过程输出信息有点略多，经常找不到有用的报错信息。&lt;/p&gt;

&lt;!-- more --&gt;

&lt;h2 id=&quot;rcurl错误及解决&quot;&gt;rCurl错误及解决&lt;/h2&gt;

&lt;p&gt;1.出错信息如下：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;* installing *source* package ‘RCurl’ …
** 成功将‘RCurl’程序包解包并MD5和检查
checking for curl-config… no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/ypchen/R/x86_64-pc-linux-gnu-library/2.14/RCurl’

下载的程序包在
‘/tmp/Rtmpz1sA0G/downloaded_packages’里
警告信息：
In install.packages(“RCurl”) : 安装程序包‘RCurl’时退出状态的值不是0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;2.缺少curl-config&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install libcurl-dev
sudo apt-get install libcurl4-gnutls-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;上面两句总有一个能解决问题，都试一下就好&lt;/p&gt;

&lt;h2 id=&quot;rjava错误及解决&quot;&gt;rJava错误及解决&lt;/h2&gt;

&lt;p&gt;错误信息如下：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver    : '/usr/bin/jar'
compiler    : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags   : '-I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include -I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include/linux'
java libs   : '-L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64 -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64 -L -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm'
checking whether JNI programs can be compiled... yes
checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
ERROR: configuration failed for package ‘rJava’
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;经常出现这种我装了Java环境但是rJava识别不出来的错误，所以需要安装一下&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install r-cran-rjava
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;重新执行安装rJava即可&lt;/p&gt;
</description>
        <pubDate>Sun, 03 Jul 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/07/03/install-r-package-rcurl-and-rjava-failed.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/07/03/install-r-package-rcurl-and-rjava-failed.html</guid>
        
        <category>战Error</category>
        
      </item>
    
      <item>
        <title>ubuntu 16.04遇到“已安装的 post-installation 脚本 返回了错误号 127 ”问题的解决</title>
        <description>&lt;p&gt;升级ubuntu 16.04后，Mysql是明显在升级过程中挂掉了，版本没有更新就算了，连数据库都打不开了，重装的时候碰到了新的错误提示：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;已安装的 post-installation 脚本 返回了错误号 127 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;不管是用remove autoremove都没用，后来看网上教程搞定的，贴在这里好了。&lt;/p&gt;

&lt;!-- more --&gt;
&lt;p&gt;1.将/var/lib/dpkg/info目录备份&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mv /var/lib/dpkg/info  /var/lib/dpkg/info_backup
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;2.新建空info目录&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mkdir /var/lib/dpkg/info
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;3.更新安装软件&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install update
sudo apt-get -f install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;4.把info下新加的文件移到backup目录&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_backup
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;5.恢复info目录名称&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo rm -rf /var/lib/dpkg/info
sudo mv /var/lib/dpkg/info_backup /var/lib/dpkg/info
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;6.重新安装所需的软件&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install mysql-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;此时不再有标题中的报错&lt;/p&gt;
</description>
        <pubDate>Wed, 29 Jun 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/06/29/ubuntu16.04-post-installation-error-127.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/06/29/ubuntu16.04-post-installation-error-127.html</guid>
        
        <category>战Error</category>
        
      </item>
    
      <item>
        <title>ubuntu更新16.04后phpmyadmin报500错误及sublime中文下沉三分之一行</title>
        <description>&lt;p&gt;更新系统后问题还是挺多的，一部分的软件升级的时候就出错，必须要重装，还有一部分打开以后出现各种各样奇怪的bug，需要一一解决。&lt;/p&gt;

&lt;!-- more --&gt;

&lt;h1 id=&quot;phpmyadmin报500错误无法打开&quot;&gt;phpmyadmin报500错误无法打开&lt;/h1&gt;

&lt;p&gt;更新后无法使用phpmyadmin，浏览器直接报500错误，页面无法显示（innternal server error），重装phpmyadmin也无济于事，本以为是apache2的问题，经过一系列排除后，应该是phpmyadmin自己的问题。&lt;/p&gt;

&lt;p&gt;先查到phpmyadmin的安装指导，写到要修改config.example.inc.php为config.inc.php然后修改当中的配置项。&lt;/p&gt;

&lt;p&gt;之前14.04系统安装的时候自动给配置好了，而现在需要自己动手操作，如果不需要修改配置也可以只改好文件名使用默认配置。&lt;/p&gt;

&lt;p&gt;再次刷新还是报错，到/var/log/apache2/error.log中查apache2的错误信息，有这么一条：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PHP Fatal error: require_once(): Failed opening required './libraries/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/select_lang.lib.php on line 370
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;结果就很明显了，应该是升级了php7.0以后缺少了 php-gettext，执行下面语句就可以解决了：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install php-gettext
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;sublime-text-3-输入中文相比英文下沉13行&quot;&gt;sublime text 3 输入中文相比英文下沉1/3行&lt;/h1&gt;

&lt;p&gt;打开sublime text 3 没看到报错，那这个应该是默认字体的锅。&lt;/p&gt;

&lt;p&gt;在Preferences中选择Setting-User，弹出的窗口里填上：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
	&quot;font_face&quot;: &quot;SourceHanSansSC&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;就能直接看到效果了，问题解决。&lt;/p&gt;
</description>
        <pubDate>Thu, 23 Jun 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/06/23/phpmyadmin-and-sublime-error-after-ubuntu16.04-upgrade.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/06/23/phpmyadmin-and-sublime-error-after-ubuntu16.04-upgrade.html</guid>
        
        <category>经验积累</category>
        
      </item>
    
      <item>
        <title>apache2提示Syntax error on line 74 of /etc/apache2/apache2.conf</title>
        <description>&lt;p&gt;ubuntu16.04升级后，问题真的是一大堆。首先是mysql升级失败无法使用，然后是apache2启动报错，从提示信息来看是找不到配置变量。&lt;/p&gt;

&lt;!-- more --&gt;

&lt;p&gt;执行apache2 -V查看apache2的版本信息时，出现如下提示：&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;	
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.942472 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_LOCK_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.942560 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_PID_FILE&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.942602 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_RUN_USER&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.942613 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_RUN_GROUP&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.942627 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.947913 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.948051 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Fri Nov 29 17:35:43.948075 2013] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;core:warn] &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;pid 14655] AH00111: Config variable &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_LOG_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; is not defined

AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;argument file:&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APACHE_LOCK_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;apache2从/etc/apache2/envvars文件中读取配置变量，看情况应该是读取失败了，手动执行一下&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; /etc/apache2/envvars&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;然后重新查看一下apache2 -V，就能看到正确的信息了。&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;	
Server version: Apache/2.4.18 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Ubuntu&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Server built:   2016-04-15T18:00:57
Servers Module Magic Number: 20120211:52
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     &lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;variable process count&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Server compiled with....
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; APR_HAS_SENDFILE
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; APR_HAS_MMAP
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; APR_HAVE_IPV6 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;IPv4-mapped addresses enabled&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; APR_USE_SYSVSEM_SERIALIZE
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; APR_USE_PTHREAD_SERIALIZE
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; APR_HAS_OTHER_CHILD
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; AP_HAVE_RELIABLE_PIPED_LOGS
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;DYNAMIC_MODULE_LIMIT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;256
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;HTTPD_ROOT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/etc/apache2&quot;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;SUEXEC_BIN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/usr/lib/apache2/suexec&quot;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;DEFAULT_PIDLOG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/var/run/apache2.pid&quot;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;DEFAULT_SCOREBOARD&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;logs/apache_runtime_status&quot;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;DEFAULT_ERRORLOG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;logs/error_log&quot;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;AP_TYPES_CONFIG_FILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;mime.types&quot;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;SERVER_CONFIG_FILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;apache2.conf&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</description>
        <pubDate>Thu, 23 Jun 2016 00:00:00 +0000</pubDate>
        <link>http://zhangyumin.github.io/blog/2016/06/23/apache2-config-variables-is-not-defined.html</link>
        <guid isPermaLink="true">http://zhangyumin.github.io/blog/2016/06/23/apache2-config-variables-is-not-defined.html</guid>
        
        <category>经验积累</category>
        
      </item>
    
  </channel>
</rss>
