gdb 调试工具使用笔记

GDB简单使用方式

1.首先编译c文件
gcc -g test.c -o test
-g 参数 用来产生调试符号

2.gdb test 使用gdb开始调试 进入如下界面

GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/logbird/c/a.out...done.
(gdb)

阅读全文>>

标签: ubuntu c Linux gdb 调试技术 断点

评论(0) 引用(0) 浏览(14)

PHP安装扩展报错

If this error occurs when you are trying to install a PHP Pecl extension, the chances are you don't have autoconf installed on your system:

root@brezhnev:/usr/src/php-5.2.6# pecl install pdo
WARNING: channel "pecl.php.net" has updated its protocols, use "channel-update pecl.php.net" to update
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
.............done: 52,613 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.

I won't assume any particular distro here - instead here's where you can go to get the autoconf and m4 sources. Follow these steps to download and install them. Your extension installations should work just fine thereafter:

# cd /usr/src
# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# tar -zvxf m4-1.4.9.tar.gz
# cd m4-1.4.9/
# ./configure && make && make install
# cd ../
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install

标签: php phpize pecl

评论(2) 引用(0) 浏览(29)

LAMP环境的安装配置

//MYSQL 安装流程整理
apt-get install libncurses5-dev
apt-get install g++

./configure --prefix=/usr/local/mysql
make && make install
sudo cp support-files/my-medium.cnf /etc/my.cnf
bin/mysql_install_db --user=mysql
sudo groupadd mysql
sudo useradd -g mysql mysql
mysql:bin/mysqld_safe –user=mysql &

MYSQL 报错的 来这里看:http://www.todeer.com/post-78.html
//apache的配置
apache 直接 编译安装即可 没有什么特别的
./configure --prefix=/usr/local/apache2
make
make install

//php 的配置
解压freetype
./configure --prefix=/usr/local/freetype
make && make install
或者

apt-get install libfreetype6-dev


编译php
apt-get install libxml2-dev
apt-get install libpng-dev
apt-get install libgif-dev
apt-get install libjpeg62-dev

./configure --prefix=/usr/local/php5 --sysconfdir=/etc --with-gd --with-curl --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-png-dir=/usr/local  --enable-exif --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr --disable-cli 


6.2,编辑“/usr/local/apache2/conf/httpd.conf ”文件:

6.2.1,找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

6.2.2,设置 WEB 默认文件:

查找:

    DirectoryIndex index.html

替换为:

    DirectoryIndex index.htm index.html index.html.var index.php

//在 WEB 目录不到默认文件,httpd 就会执行 /var/www/error/noindex.html

6.2.3,让Apache 支持rewrite:

找到这一段:

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be “All”, “None”, or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

将“AllowOverride None”修改为:

    AllowOverride All

6.2.4,更改网站根目录:

查找:

    DocumentRoot “/usr/local/apache2/htdocs”

改为:

    DocumentRoot “/home/www”

查找:

    <Directory “/usr/local/apache2/htdocs”>

改为:

    <Directory “/home/www”>

6.2.5:找到以下内容并去掉注释:

    Include conf/extra/httpd-mpm.conf

    Include conf/extra/httpd-info.conf

    Include conf/extra/httpd-vhosts.conf

    Include conf/extra/httpd-default.conf

6.2.6,让页面支持gzip:

在“LoadModule php5_module        modules/libphp5.so”之后添加:

    <IfModule mod_deflate.c>
    DeflateCompressionLevel 6
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
    AddOutputFilter DEFLATE css js
    </IfModule>

标签: php mysql apache Linux GCC Makefile Lamp

评论(2) 引用(0) 浏览(39)

标准C I/O函数总结(未完待续)

getchar(void)
getc(FILE *f)
fgetc(FILE *f)

putchar(int c)
putc(int c, FILE *f)
fputc(int c, FILE *f)

gets(char *buffer)
fgets(char *buffer, int buffer_size, FILE *f)

puts(char *buffer)
fputs(char *buffer, FILE *f)

printf(char *format, [mixed,...])
fprintf(FILE *f, char *format, [mixed,...])
sprintf(char *source, char *format, [mixed,...])

scanf(char *format, [mixed,...])
fscanf(FILE *f, char *format, [mixed,...])
sscanf(char *source, char *format, [mixed,...])


fread(void *buffer, size_t size, size_t count, FILE *stream);
fwrite(void *buffer, size_t size, size_t count, FILE *stream);

fflush(FILE *f);
ftell (FILE *f)
fseek (FILE *f, long offset, int from)    SEEK_SET SEEK_CUR SEEK_END

rewind(FILE *f)
fgetpos(FILE *f, fpos_t *ft)
fsetpos(FILE *f, fpos_t *ft)

setbuf(FILE *f, char *c)    默认大小:BUFSIZ
setvbuf(FILE *f, char *buffer, int type, size_t size)
type:
    _IOFBF(满缓冲):当缓冲区为空时,从流读入数据。或者当缓冲区满时,向流写入数 据。
    _IOLBF(行缓冲):每次从流中读入一行数据或向流中写入一行数据。
    _IONBF(无缓冲):直接从流中读入数据或直接向流中写入数据,而没有缓冲区。

feof(FILE *f)
ferror(FILE *f)

FILE *tmpfile(char *s)

remove(char *name)
rename(char *oldname, char *newname)

标签: c语言 I/O 标准C

评论(5) 引用(0) 浏览(62)

js的autocomplete开发

js做 autocomplete插件的时候 需要用到 oninput这个事件来触发用户输入(onchange需要用户输入完后才会触发而不是输出过程中触发),但是oninput在ff下不兼容,这个问题可以使用 onpropertychange 事件来操作 ,同事为了避免浏览器每次记录文本框输入的内容,使用 autocomplete="off" 来禁止浏览器进行自动提示。


oninput="auto_select(this.value)"

onpropertychange="auto_select(this.value)"

标签: js autocomplete oninput onpropertychange ff firefox

评论(4) 引用(0) 浏览(90)

推荐一款轻量级的jquery插件

 官方地址:

http://code.gautamlad.com/glDatePicker/

glDatePicker is a simple, customizable, lightweight date picker calendar plugin for jQuery weighing in 4KB compressed (11KB uncompressed). 

Example styles 
It includes the following features:

  • forward and backward navigation
  • current date highlight
  • restricting selection of dates outside of a range
  • restricting selection of dates beyond N-days from start date
  • restricting forward / backwards month navigation
  • individual styles per date picker (in case you have multiples on one page)
  • show currently selected date

 

附件下载:
date.rar 55.06KB

标签: jquery 插件 轻量级 datepicker date

评论(11) 引用(0) 浏览(141)

Apache的RewriteRule规则详细介绍

rewrite总忘这会 记录一份 以后方便查询。

阅读全文>>

标签: ubuntu rewrite apache proxy .htaccess

评论(4) 引用(0) 浏览(188)

No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submod ules are included in the configuration using LoadModule

apache 配置反向代理 报错。。。。

No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule

于是找到了这个文章 解决办法如下:

阅读全文>>

标签: ubuntu rewrite apache proxy .htaccess

评论(3) 引用(0) 浏览(192)

推荐的 PHP 读物列表

这份关于 PHP 的推荐阅读材料列表编辑自 IBM 的 Global Production Services 机构中的 Web 应用程序开发人员提供的各种在线资源。选择这些资源的目的是向 IT 专家和架构师介绍 PHP,提供关于安装和维护的具体信息,并帮助他们把这项技术与 IBM 的产品集成。

PHP 是一种解释型编程语言,运行在开放源码内核引擎和扩展提供的环境中,它的开发受到许多公司和个人的推动。所以,这个列表描述了针对编写 PHP 程序和定制 PHP 解释器环境的参考资料。它链接到 IBM 发布的材料和其他机构提供的内容。

这个列表定期更新。请在下面提供您的意见,帮助我们改善它。

阅读全文>>

标签: php

评论(4) 引用(0) 浏览(257)

编译 PHP 源码make install时报"dlname not found in /usr/local/apache2/modules/libphp5.la."

    解答:这是由于apache与php的libtool版本不一致引起的。
    解决方法:使php安装目录下的libtool与apache的libtool版本一致,再重新安装,操作如下:
   1. 复制 apache/build/libtool目录到 php源码目录下 
   2. make clean 
   3. make install 

标签: php apache libtool

评论(0) 引用(0) 浏览(438)

1 2 3 4 5 6 ... »