存档

2015年3月 的存档

树莓派1和树莓派2的性能对比(6):Server Benchmark

2015年3月22日 没有评论

系列文章:

树莓派1和树莓派2的性能对比(1):Synthetic PHP BenchMark

树莓派1和树莓派2的性能对比(2):Synthetic MySQL BenchMark

树莓派1和树莓派2的性能对比(3):Synthetic Read Write BenchMark

树莓派1和树莓派2的性能对比(4):Real World PHP BenchMark

树莓派1和树莓派2的性能对比(5):Real World PHP & MySQL BenchMark

上次树莓派1和Cubieboard对比的地址为:

树莓派和Cubieboard对比测试(7) – Server Benchmark

Pi Pi2
PHP version 5.6.6
MySQL version 5.5.5-10.0.17-MariaDB-log
Server Software Apache/2.4.12 (Unix) PHP/5.6.6
Server Benchmark
test_1_create_dir 0.0017 seconds 0.0009 seconds
test_1_small_page 0.4914 seconds 0.1713 seconds
test_1b_small_page 0.4885 seconds 0.1394 seconds
test_1c_small_page 0.4882 seconds 0.1392 seconds
test_1d_small_page 0.4898 seconds 0.1392 seconds
test_1e_small_page 0.4889 seconds 0.1397 seconds
test_2_create_tempfile 0.0016 seconds 0.0008 seconds
test_2_medium_page 1.3283 seconds 0.4323 seconds
test_2b_medium_page 1.3281 seconds 0.4348 seconds
test_2c_medium_page 1.3297 seconds 0.4374 seconds
test_2d_medium_page 1.3283 seconds 0.4361 seconds
test_2e_medium_page 1.3318 seconds 0.4373 seconds
test_3_large_page 3.9221 seconds 1.3041 seconds
test_3_write 0.1565 seconds 0.0558 seconds
test_3b_large_page 3.9231 seconds 1.3027 seconds
test_3c_large_page 3.9270 seconds 1.3016 seconds
test_3d_large_page 3.9473 seconds 1.3015 seconds
test_3e_large_page 3.9296 seconds 1.3024 seconds
test_4_append 0.1028 seconds 0.0383 seconds
test_4_huge_page 6.2111 seconds 2.0126 seconds
test_4b_append 0.0999 seconds 0.0376 seconds
test_4b_huge_page 6.1738 seconds 2.0134 seconds
test_4c_huge_page 6.2370 seconds 2.0141 seconds
test_4d_huge_page 6.2073 seconds 2.0137 seconds
test_4e_huge_page 6.2364 seconds 2.0114 seconds
test_5_fileinfo 0.3223 seconds 0.1466 seconds
test_6_read_1024 1.9919 seconds 0.5921 seconds
test_6b_read_512 1.9095 seconds 0.5338 seconds
test_6c_read_256 2.5433 seconds 0.7696 seconds
test_6d_read_128 4.1118 seconds 1.1324 seconds
test_6e_read_64 7.1683 seconds 2.0073 seconds
test_6f_read_32 12.9881 seconds 3.5275 seconds
test_6g_read_16 28.5116 seconds 7.2687 seconds
test_7_read_8 33.9870 seconds 9.7546 seconds
test_9_readdir 1.6711 seconds 0.6747 seconds
test_arithmetic 0.0060 seconds 0.0015 seconds
test_array_operators 0.0101 seconds 0.0028 seconds
test_bitwise 0.0013 seconds 0.0005 seconds
test_casting 0.0283 seconds 0.0066 seconds
test_chr_fixed 0.0482 seconds 0.0116 seconds
test_chr_hardcoded 0.0093 seconds 0.0032 seconds
test_chr_var 0.0407 seconds 0.0107 seconds
test_comment_loop 0.0022 seconds 0.0014 seconds
test_compare 0.0020 seconds 0.0009 seconds
test_compare_false 0.0002 seconds 0.0001 seconds
test_compare_invert 0.0003 seconds 0.0001 seconds
test_compare_strict 0.0004 seconds 0.0001 seconds
test_compare_unstrict 0.0008 seconds 0.0003 seconds
test_connect_db 0.0587 seconds 0.0172 seconds
test_constants 0.0039 seconds 0.0011 seconds
test_crc32 0.0027 seconds 0.0007 seconds
test_db_setup 0.6793 seconds 0.1770 seconds
test_del_file 0.0014 seconds 0.0008 seconds
test_del_tempdir 0.0010 seconds 0.0004 seconds
test_distinctcolumn 1.8773 seconds 0.6269 seconds
test_do_while 0.0097 seconds 0.0051 seconds
test_do_while_break 0.0021 seconds 0.0011 seconds
test_empty 0.0003 seconds 0.0001 seconds
test_empty_loop 0.0024 seconds 0.0014 seconds
test_fetcharray 1.3069 seconds 0.4140 seconds
test_fetchassoc 1.1749 seconds 0.3709 seconds
test_fetchlength 1.1717 seconds 0.3643 seconds
test_fetchrow 1.1665 seconds 0.3681 seconds
test_fieldflags 3.4805 seconds 1.0895 seconds
test_foreach 0.0433 seconds 0.0153 seconds
test_get_class 0.0030 seconds 0.0008 seconds
test_global_scalar_assign 0.0014 seconds 0.0006 seconds
test_global_string_assign 0.0077 seconds 0.0029 seconds
test_if_constant 0.0004 seconds 0.0002 seconds
test_increment 0.0029 seconds 0.0010 seconds
test_is_array 0.0010 seconds 0.0003 seconds
test_is_object 0.0010 seconds 0.0003 seconds
test_is_type 0.0032 seconds 0.0009 seconds
test_isset 0.0003 seconds 0.0001 seconds
test_line 0.0004 seconds 0.0002 seconds
test_local_array_assign 0.0342 seconds 0.0096 seconds
test_local_boolean_assign 0.0021 seconds 0.0007 seconds
test_local_float_assign 0.0021 seconds 0.0007 seconds
test_local_hash_assign 0.0019 seconds 0.0007 seconds
test_local_integer_assign 0.0020 seconds 0.0007 seconds
test_local_object_assign 0.0020 seconds 0.0006 seconds
test_local_scalar_assign 0.0031 seconds 0.0010 seconds
test_local_string_assign 0.0078 seconds 0.0025 seconds
test_maxget 0.9734 seconds 0.3113 seconds
test_md5 0.0040 seconds 0.0014 seconds
test_microtime 0.0163 seconds 0.0043 seconds
test_mt_rand 0.0016 seconds 0.0005 seconds
test_numfields 2.5441 seconds 0.7369 seconds
test_numrows 2.5617 seconds 0.7237 seconds
test_ord 0.1501 seconds 0.0443 seconds
test_ordered_functions 0.0234 seconds 0.0101 seconds
test_ordered_functions_references 0.0228 seconds 0.0098 seconds
test_page1a 0.2641 seconds 0.0792 seconds
test_page1b 0.2585 seconds 0.0781 seconds
test_page1c 0.2621 seconds 0.0779 seconds
test_page1d 0.2613 seconds 0.0781 seconds
test_page1e 0.2598 seconds 0.0781 seconds
test_page2a 0.7814 seconds 0.2352 seconds
test_page2b 0.7866 seconds 0.2332 seconds
test_page2c 0.8034 seconds 0.2333 seconds
test_page2d 0.7826 seconds 0.2341 seconds
test_page2e 0.7810 seconds 0.2342 seconds
test_page3a 1.1535 seconds 0.3559 seconds
test_page3b 1.1828 seconds 0.3559 seconds
test_page3c 1.1847 seconds 0.3560 seconds
test_page3d 1.1614 seconds 0.3560 seconds
test_page3e 1.1867 seconds 0.3562 seconds
test_page4a 1.5888 seconds 0.4892 seconds
test_page4b 1.5672 seconds 0.4886 seconds
test_page4c 1.5672 seconds 0.4895 seconds
test_page4d 1.5980 seconds 0.4899 seconds
test_page4e 1.5838 seconds 0.4891 seconds
test_preg_match 0.0111 seconds 0.0028 seconds
test_rand 0.0015 seconds 0.0005 seconds
test_references 0.0004 seconds 0.0002 seconds
test_rowcount 0.5033 seconds 0.1234 seconds
test_sha1 0.0073 seconds 0.0016 seconds
test_sort 4.1689 seconds 1.2160 seconds
test_sort2 4.1101 seconds 1.3251 seconds
test_sort3 4.2083 seconds 1.2172 seconds
test_string_append 0.0058 seconds 0.0021 seconds
test_strlen 0.0010 seconds 0.0003 seconds
test_sumcolumn 1.0162 seconds 0.3223 seconds
test_switch 0.0070 seconds 0.0034 seconds
test_time 0.0016 seconds 0.0005 seconds
test_unordered_functions 0.0266 seconds 0.0112 seconds
test_variable_variables 0.0032 seconds 0.0009 seconds
test_while 0.0091 seconds 0.0056 seconds
test_write 0.6625 seconds 0.1705 seconds
test_write2 0.7029 seconds 0.1888 seconds
test_write3 0.7162 seconds 0.1961 seconds
test_write_cleanup 0.0103 seconds 0.0040 seconds
Score(higher is better) 144 484

树莓派1和树莓派2的性能对比(5):Real World PHP & MySQL BenchMark

2015年3月22日 没有评论

系列文章:

树莓派1和树莓派2的性能对比(1):Synthetic PHP BenchMark

树莓派1和树莓派2的性能对比(2):Synthetic MySQL BenchMark

树莓派1和树莓派2的性能对比(3):Synthetic Read Write BenchMark

树莓派1和树莓派2的性能对比(4):Real World PHP BenchMark

上次树莓派1和Cubieboard对比的地址为:

树莓派和Cubieboard对比测试(6) – Real World PHP & MySQL BenchMark

Pi Pi2
PHP version 5.6.6
MySQL version 5.5.5-10.0.17-MariaDB-log
Server Software Apache/2.4.12 (Unix) PHP/5.6.6
Real World PHP & MySQL BenchMark
test_page1a 2.3365 seconds 0.7525 seconds
test_page1b 2.3499 seconds 0.7534 seconds
test_page1c 2.3339 seconds 0.7531 seconds
test_page1d 2.3447 seconds 0.7529 seconds
test_page1e 2.3353 seconds 0.7529 seconds
test_page2a 6.4310 seconds 1.8929 seconds
test_page2b 6.3900 seconds 1.8923 seconds
test_page2c 6.4243 seconds 1.8913 seconds
test_page2d 6.4153 seconds 1.8927 seconds
test_page2e 6.4204 seconds 1.8924 seconds
test_page3a 9.0395 seconds 2.6444 seconds
test_page3b 9.3039 seconds 2.6462 seconds
test_page3c 8.9621 seconds 2.6440 seconds
test_page3d 8.9731 seconds 2.6467 seconds
test_page3e 8.9627 seconds 2.6429 seconds
test_page4a 12.5272 seconds 3.7309 seconds
test_page4b 12.3040 seconds 3.7344 seconds
test_page4c 12.7825 seconds 3.7329 seconds
test_page4d 12.3229 seconds 3.7370 seconds
test_page4e 12.4328 seconds 3.7291 seconds
Score(higher is better) 198 665

树莓派1和树莓派2的性能对比(4):Real World PHP BenchMark

2015年3月22日 没有评论

系列文章:

树莓派1和树莓派2的性能对比(1):Synthetic PHP BenchMark

树莓派1和树莓派2的性能对比(2):Synthetic MySQL BenchMark

树莓派1和树莓派2的性能对比(3):Synthetic Read Write BenchMark

上次树莓派1和Cubieboard对比的地址为:

树莓派和Cubieboard对比测试(5) – Real World PHP BenchMark

Pi Pi2
PHP version 5.6.6
MySQL version 5.5.5-10.0.17-MariaDB-log
Server Software Apache/2.4.12 (Unix) PHP/5.6.6
Real World PHP BenchMark
test_1_small_page 1.1907 seconds 0.5099 seconds
test_1b_small_page 1.1620 seconds 0.3424 seconds
test_1c_small_page 1.1608 seconds 0.3422 seconds
test_1d_small_page 1.1648 seconds 0.3435 seconds
test_1e_small_page 1.1701 seconds 0.3411 seconds
test_2_medium_page 3.2147 seconds 1.0279 seconds
test_2b_medium_page 3.2330 seconds 1.0329 seconds
test_2c_medium_page 3.3178 seconds 1.0358 seconds
test_2d_medium_page 3.3654 seconds 1.0369 seconds
test_2e_medium_page 3.3518 seconds 1.0372 seconds
test_3_large_page 9.9856 seconds 3.1942 seconds
test_3b_large_page 10.2158 seconds 3.1947 seconds
test_3c_large_page 9.9806 seconds 3.1957 seconds
test_3d_large_page 10.2136 seconds 3.1958 seconds
test_3e_large_page 10.2217 seconds 3.1928 seconds
test_4_huge_page 15.8610 seconds 4.9444 seconds
test_4b_huge_page 15.5103 seconds 4.9461 seconds
test_4c_huge_page 15.8390 seconds 4.9671 seconds
test_4d_huge_page 15.6031 seconds 4.9714 seconds
test_4e_huge_page 15.6240 seconds 4.9754 seconds
Score(higher is better) 297 941

树莓派1和树莓派2的性能对比(3):Synthetic Read Write BenchMark

2015年3月22日 没有评论

系列文章:

树莓派1和树莓派2的性能对比(1):Synthetic PHP BenchMark

树莓派1和树莓派2的性能对比(2):Synthetic MySQL BenchMark

上次树莓派1和Cubieboard对比的地址为:

树莓派和Cubieboard对比测试(4) – Synthetic Read/Write BenchMark

Pi Pi2
PHP version 5.6.6
MySQL version 5.5.5-10.0.17-MariaDB-log
Server Software Apache/2.4.12 (Unix) PHP/5.6.6
Synthetic Read Write BenchMark
test_1_create_dir 0.0014 seconds 0.0010 seconds
test_2_create_tempfile 0.0015 seconds 0.0009 seconds
test_3_write 0.2340 seconds 0.1246 seconds
test_4_append 0.1555 seconds 0.0863 seconds
test_4b_append 0.1521 seconds 0.0840 seconds
test_5_fileinfo 0.4854 seconds 0.2825 seconds
test_6_read_1024 4.3047 seconds 1.2699 seconds
test_6b_read_512 4.4377 seconds 1.1854 seconds
test_6c_read_256 6.0634 seconds 1.7323 seconds
test_6d_read_128 9.6558 seconds 2.6062 seconds
test_6e_read_64 14.4697 seconds 4.5069 seconds
test_6f_read_32 24.8038 seconds 7.7512 seconds
test_6g_read_16 52.2430 seconds 15.5660 seconds
test_7_read_8 74.0824 seconds 21.8323 seconds
test_9_readdir 2.4713 seconds 1.0116 seconds
test_del_file 0.0014 seconds 0.0008 seconds
test_del_tempdir 0.0010 seconds 0.0004 seconds
Score(higher is better) 124 413

树莓派1和树莓派2的性能对比(2):Synthetic MySQL BenchMark

2015年3月22日 没有评论

系列文章:

树莓派1和树莓派2的性能对比(1):Synthetic PHP BenchMark

上次树莓派1和Cubieboard对比的地址为:

树莓派和Cubieboard对比测试(3) – Synthetic MySQL BenchMark

Pi Pi2
PHP version 5.6.6
MySQL version 5.5.5-10.0.17-MariaDB-log
Server Software Apache/2.4.12 (Unix) PHP/5.6.6
Synthetic MySQL BenchMark
test_db_setup 1.3504 seconds 0.4811 seconds
test_distinctcolumn 6.0972 seconds 2.0539 seconds
test_fetcharray 3.4702 seconds 1.0954 seconds
test_fetchassoc 3.1557 seconds 1.0263 seconds
test_fetchlength 3.1741 seconds 1.0148 seconds
test_fetchrow 3.1540 seconds 1.2152 seconds
test_fieldflags 13.0071 seconds 3.5117 seconds
test_maxget 2.8478 seconds 0.8929 seconds
test_numfields 8.9720 seconds 2.2549 seconds
test_numrows 10.1692 seconds 2.2571 seconds
test_rowcount 1.0088 seconds 0.2399 seconds
test_sort 15.3296 seconds 4.1467 seconds
test_sort2 16.1388 seconds 4.1016 seconds
test_sort3 15.2947 seconds 4.1456 seconds
test_sumcolumn 2.8440 seconds 0.9381 seconds
test_write 1.3475 seconds 0.3367 seconds
test_write2 1.3922 seconds 0.3848 seconds
test_write3 1.4473 seconds 0.3876 seconds
test_write_cleanup 0.0107 seconds 0.0044 seconds
Score(higher is better) 145 524

树莓派1和树莓派2的性能对比(1):Synthetic PHP BenchMark

2015年3月22日 没有评论

两代树莓派硬件的主要区别是,主频高了一些,cpu变成了4核,ram变成了1GB。

上次树莓派1和Cubieboard对比的地址为:树莓派和Cubieboard对比测试(2) – Synthetic PHP BenchMark

Pi Pi2
PHP version 5.6.6
MySQL version 5.5.5-10.0.17-MariaDB-log
Server Software Apache/2.4.12 (Unix) PHP/5.6.6
Synthetic PHP BenchMark
test_arithmetic 0.2261 seconds 0.1105 seconds
test_array_operators 0.2856 seconds 0.1700 seconds
test_bitwise 0.0383 seconds 0.0216 seconds
test_casting 1.3268 seconds 0.3272 seconds
test_chr_fixed 1.8898 seconds 0.5745 seconds
test_chr_hardcoded 0.4025 seconds 0.1578 seconds
test_chr_var 1.8833 seconds 0.5317 seconds
test_comment_loop 0.1064 seconds 0.0676 seconds
test_compare 0.1038 seconds 0.0417 seconds
test_compare_false 0.0056 seconds 0.0033 seconds
test_compare_invert 0.0084 seconds 0.0041 seconds
test_compare_strict 0.0084 seconds 0.0052 seconds
test_compare_unstrict 0.0307 seconds 0.0145 seconds
test_constants 0.1514 seconds 0.0500 seconds
test_crc32 0.1210 seconds 0.0352 seconds
test_do_while 0.4012 seconds 0.2534 seconds
test_do_while_break 0.0931 seconds 0.0541 seconds
test_empty 0.0057 seconds 0.0038 seconds
test_empty_loop 0.1062 seconds 0.0676 seconds
test_foreach 1.9737 seconds 0.8063 seconds
test_get_class 0.1385 seconds 0.0381 seconds
test_global_scalar_assign 0.0477 seconds 0.0266 seconds
test_global_string_assign 0.3587 seconds 0.1446 seconds
test_if_constant 0.0131 seconds 0.0090 seconds
test_increment 0.1622 seconds 0.0494 seconds
test_is_array 0.0365 seconds 0.0123 seconds
test_is_object 0.0396 seconds 0.0124 seconds
test_is_type 0.1358 seconds 0.0442 seconds
test_isset 0.0076 seconds 0.0045 seconds
test_line 0.0099 seconds 0.0065 seconds
test_local_array_assign 0.8565 seconds 0.3604 seconds
test_local_boolean_assign 0.0727 seconds 0.0316 seconds
test_local_float_assign 0.0731 seconds 0.0319 seconds
test_local_hash_assign 0.0685 seconds 0.0314 seconds
test_local_integer_assign 0.1053 seconds 0.0319 seconds
test_local_object_assign 0.0809 seconds 0.0280 seconds
test_local_scalar_assign 0.1006 seconds 0.0448 seconds
test_local_string_assign 0.2859 seconds 0.1169 seconds
test_md5 0.1953 seconds 0.0662 seconds
test_microtime 0.6788 seconds 0.2107 seconds
test_mt_rand 0.0649 seconds 0.0216 seconds
test_ord 6.4353 seconds 2.2288 seconds
test_ordered_functions 1.0930 seconds 0.4972 seconds
test_ordered_functions_references 0.9427 seconds 0.4826 seconds
test_preg_match 0.4483 seconds 0.1258 seconds
test_rand 0.0735 seconds 0.0223 seconds
test_references 0.0108 seconds 0.0072 seconds
test_sha1 0.2715 seconds 0.0810 seconds
test_string_append 0.2736 seconds 0.0996 seconds
test_strlen 0.0459 seconds 0.0127 seconds
test_switch 0.3535 seconds 0.1650 seconds
test_time 0.0618 seconds 0.0256 seconds
test_unordered_functions 1.1314 seconds 0.5539 seconds
test_variable_variables 0.1076 seconds 0.0407 seconds
test_while 0.4435 seconds 0.2794 seconds
Score(higher is better) 410 1082

启用Raspberry树莓派的i2c总线

2015年3月20日 没有评论

其实我是在看mono的i2c接口程序,发现我的/dev里面没有i2c-0和i2c-1这两个设备,于是查了一下。发现按照国内大部分教程为linux添加i2c-dev的驱动以后,并没有解决问题。翻墙找了找,如果单纯添加驱动不能解决问题的话,就需要修改/boot/config.txt了。

修改/boot/config.txt方法:

找到 device_tree_param=i2c_arm=on 和 device_tree_param=i2c_vc=on ,然后将其前面的注释去掉。

树莓派应该是有两条i2c总线?我不确定。不过一般情况在,/dev中会有i2c-0和i2c-1两个设备,上面两条如果只取消注释一条的话,那么只会出现一个i2c设备。i2c_arm对应的是i2c-1,i2c_vc对应的是i2c-0。

修改/etc/modules-load.d/raspberrypi.conf方法:

最后面添加i2c-dev。

这时候重启应该就可以看到/dev里面的i2c设备了。

再往下可以安装i2c-tools来查看工作状态了。这个自行搜索怎么用吧,我也没研究呢。

题外话:

  • 从上面的试验可以看出,config.txt的优先级要比linux内核驱动的优先级高,可以直接关闭设别,这样驱动也就无效了。
  • config.txt里面有i2c的速率设置方式,相应模块也有速率设置的方式,这两个优先级没有测试。
  • 有的linux发布上还有blacklist的设置,还需要从黑名单中去掉i2c设备。ArchLinuxARM这个是空的。
  • 目前是在Pi 1 B+上进行的测试。在Pi 1 B和Pi 2 B上还没有测试。根据文档看,貌似有区别,但是中说纷纭,有待测试。
  • DS1307硬时钟是i2c接口的,所以在使用DS1307前,需要保证i2c正常。

Arduino LCD 1602 Keypad Shield实例代码(带DFROBOT字样的那种)

2015年3月19日 没有评论

买东西的地方给的kuaipan的地址,但是貌似关闭分享功能了。去淘宝找了一下卖类似东东的网店,终于发现一家直接把代码贴上来了。我试验了一下,可用。纯属没地方放,另外给搜索过来的朋友做个参考,整段代码贴上来当做笔记。1602应该是四线模式,几个按键应该是模拟方式,也就是不支持多键同时按下。RST键会直接RESET。

#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);

char msgs[5][16] = {"Right Key OK ",
                    "Up Key OK    ",              
                    "Down Key OK  ",
                    "Left Key OK  ",
                    "Select Key OK" };

int adc_key_val[5] ={50, 200, 400, 600, 800 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;

void setup() {
  // put your setup code here, to run once:
  lcd.clear();
  lcd.begin(16, 2);
  lcd.setCursor(0,0);
  lcd.print("ADC key testing");
}

void loop() {
  // put your main code here, to run repeatedly:
  adc_key_in = analogRead(0);    // read the value from the sensor
  key = get_key(adc_key_in);  // convert into key press
 
  if (key != oldkey)   // if keypress is detected
   {
    delay(50);  // wait for debounce time
    adc_key_in = analogRead(0);    // read the value from the sensor
    key = get_key(adc_key_in);    // convert into key press
    if (key != oldkey)   
    {  
      lcd.setCursor(0, 1);
      oldkey = key;
      if (key >=0){
           lcd.print(msgs[key]);             
      }
    }
  }
delay(100);
}

// Convert ADC value to key number
int get_key(unsigned int input)
{
    int k;
  
    for (k = 0; k < NUM_KEYS; k++)
    {
      if (input < adc_key_val[k])
{
            return k;
        }
   }
  
    if (k >= NUM_KEYS)k = -1;  // No valid key pressed
    return k;
}

分类: Arduino 标签:

Piwik升级,提示curl_exec超时问题解决

2015年3月7日 没有评论

如果你的Piwik升级的时候提示curl_exec出错的话,恭喜你,估计你是在2.11.0或2.11.1这两个版本。2.11.0默认是10秒,2.11.1默认是30秒。如果这个时间搞不定,就报错。估计没谁的主机能这么快,比如我的。

查了一下,可以修改plugins/CoreUpdater/Controller.php的175行。

如果你是2.11.0,应该是如下的样子

Http::fetchRemoteFile($url, $this->pathPiwikZip);

如果你是2.11.1,应该是如下的样子

Http::fetchRemoteFile($url, $this->pathPiwikZip, 0, 30);

2.11.2以后的样子:

Http::fetchRemoteFile($url, $this->pathPiwikZip, 0, 120);

 

修改版本很简单,修改为2.11.2的样子就好,因为2.11.2就没有这个问题了。

分类: 未分类 标签:

树莓派2上玩ArchLinux+LAMP(3):安装MariaDB、Apache和PHP

2015年3月7日 没有评论

系列文章:

(1)TF卡制作环境:http://just4fun.cn/?p=725

(2)TF卡制作:http://just4fun.cn/?p=727

 

MariaDB是在Oracle收购MySQL以后,社区做的开源分支。目前ArchLinux已经把MariaDB作为了MySQL的默认替代,我们这里也以MariaDB作为替代。MariaDB和MySQL协议兼容,内部应用也保持原样,所以除了在安装的时候不一样以外,后面的步骤的都类似。Apache和PHP就不说了,大家都懂的。

1.安装和配置MariaDB

(1)首先使用pacman –Syu升级系统上的现有的组件。

(2)接着执行pacman –S mariadb。这个命令会安装MariaDB服务器端、客户端命令行工具和客户端库。

(3)使用systemctl enable mysqld.service命令启用MariaDB服务。使用systemctl start mysqld.service立即启动MariaDB。

(4)启动以后,使用mysql_secure_intallation命令启用安全配置向导。按照向导回答问题就好。具体问题代表什么请自己查询MariaDB或者MySQL的资料。

(5)如果你不需要开启root的远程访问,这个时候你的MariaDB就已经安装好了。如果你需要开启root的远程访问,那请往下继续。

(6)执行mysql –u root –p,之后会提示你输入密码。密码是刚才安全向导中设置过的。除非你没设置。

(7)先执行use mysql;然后执行grant all privileges on *.* to ‘root’@’%’ with grant option;

(8)再执行grant all privileges on *.* to ‘root’@’%’ identified by ‘mypass’ with grant option;需要注意的是不要缺少最后面的分号。上面mypass是针对远程时候root的密码,可以改成自己的。可以单独设立。执行两边是因为第一遍生成了一个没有密码的账号,第二个开启密码。

(9)之后exit退出,就全部OK了。

 

2.安装配置Apache和PHP

把Apache和PHP一起写是因为可以利用pacman提供依赖管理,在安装PHP的时候,自动安装好Apache。

(1)执行pacman –S php-apache安装apache和php的所有组件。

(2)执行vi /etc/httpd/conf/httpd.conf配置apache

LoadModule mpm_prefork_module modules/mod_mpm_perforl.so

替换

LoadModule mpm_event_module modules/mod_mpm_event.so

这是archlinux的wiki中要求的,原因我没去研究。

再在最后部分添加

LoadModule php5_module modules/libphp5.so

Include conf/extra/php5_module.conf

这会将php5的相关配置包含到httpd.conf中。

(3)执行vi /etc/php/php.ini配置php

我这里保持默认就可以了

 

3.测试

测试其实非常简单,写一个phpinfo页面就好了。

分类: Apache, ARM, ARM Box, Linux, MySQL, PHP, Raspberry Pi 标签: