2019-01-21 15:08:37 songchuwang1868 阅读数 223

命令安装的库的命名一般是lib(库名)-dev

比如显示缺少zip.h文件,推断可能是少zip

命令:

sudo apt-get install libzip-dev

yum 命令类似

2015-04-25 21:21:39 unesco3187 阅读数 630

1.首先进去 http://downloads.mysql.com/archives/community/ 下载mysql

2.




3.这里我选择    

4.进去shell命令环境 

    1.  tar -zxvf  mysql-.5.542-linux2.6-i686.tar.gz

    2.  groupadd mysql

    3.  useradd -g mysql mysql

    4.   进去到解压后的mysql目录(后面用:mysql表示)

    5.  scripts/mysql_install_db --user=mysql

    6.  chown -R root .

    7.  chown -R mysql data

    8.  chgrp -R mysql .

    9.  启动mysql      bin/mysqld_safe --user=mysql &

5.考虑以后方便启动和停止mysql服务, 可以把mysql的服务命令加入到系统/etc/init.d下

   1. cp support-files/mysql.server /etc/init.d/mysql.server

    2.后面就可以进入到/etc/init.d目录下执行./mysql.server start启动mysql服务,执行:  ./mysql.server stop停止服务

 

2012-03-20 19:54:39 aini_zlr2008 阅读数 43
GD:Linux下安装PHP的GD支持库

Linux下安装PHP的GD支持库

1、安装 zlib
wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/zlib-1.2.3.tar.gz
tar -zxf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure –prefix=/usr/local/zlib
make
make install

2、安装 jpeg
wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/jpeg-6b.tar.gz
mkdir -p /usr/local/jpeg6
mkdir -p /usr/local/jpeg6/bin
mkdir -p /usr/local/jpeg6/lib
mkdir -p /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man
mkdir -p /usr/local/jpeg6/man1
mkdir -p /usr/local/jpeg6/man/man1
tar -zxf jpeg-6b.tar.gz
cd jpeg-6b
./configure –prefix=/usr/local/jpeg6 –enable-shared –enable-static
make
make install

安装完成提示:
Libraries have been installed in:
/usr/local/jpeg6/lib

3、安装 libpng
wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/libpng-1.2.16.tar.gz
tar -zxf libpng-1.2.16.tar.gz
cd libpng-1.2.16
cd scripts/
mv makefile.linux ../makefile(必须)
cd ..
./configure -prefix=/usr/local/libpng
make
make install

4、安装 freetype
wget http://download.savannah.nongnu.org/releases/freetype/freetype-2.3.4.tar.gz
tar -zxf freetype-2.3.4.tar.gz
cd freetype-2.3.4
mkdir -p /usr/local/freetype
./configure –prefix=/usr/local/freetype
make
make install

5、安装 GD
wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/gd-2.0.33.tar.gz
tar -zxf gd-2.0.33.tar.gz
cd gd-2.0.33
mkdir -p /usr/local/gd2
./configure –prefix=/usr/local/gd2 –with-jpeg=/usr/local/jpeg6/ –with-png=/usr/local/lib/ –with-zlib=/usr/local/lib/ –with-freetype=/usr/local/freetype/
make
make install


--------------------

安装jpg时候,如果出错。

先装libtool

libtool-1.X.tar.gz //是我下载的版本

./configure
make
make install

再装jpegsrc.v6b.tar.gz

./configure --enable-shared --enable-static 这些lib这种包用默认路径就行。不然如果其他的需要这个包还得指它的路径

这里可能会出错

checking host system type… Invalid configuration `x86_64-unknown-linux-gnu ‘: machine `x86_64-unknown ‘ not recognized

checking build system type… Invalid configuration `x86_64-unknown-linux-gnu ‘: machine `x86_64-unknown ‘ not recognized

configure: error: libtool configure failed

或者

/libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c
make: ./libtool:命令未找到
make: *** [jcapimin.lo] 错误 127
./libtool --mode=compile gcc -O2 -I. -c ./cjpeg.c
make: ./libtool:命令未找到
make: *** [cjpeg.lo] 错误 127

解决方法

cp /usr/share/libtool/config.guess .
cp /usr/share/libtool/config.sub .

cp到jpeg的安装文件目录,注意后面的个“.”

make clean

再重新



./configure --prefix=/usr/local/libjpeg/ --enable-shared --enable-static

make

make install

--------------------------------
如果已经安装php,建议通过追加编译安装
进入“[php解压目录]/ext/gd”目录,执行如下命令:
[php安装目录]/bin/phpize
Java代码
./configure --with-php-config=[php安装目录]/bin/php-config --with-jpeg=[jpeg-6b安装目录] --with-png=[libpng安装目录] --with-freetype=[freetype安装目录] --with-gettext=[gettext安装目录] --with-gd=[gd安装目录]
make
make install

安装成功后会在“[php安装目录]/lib/php/extensions/no-debug-non-zts-20060613”目录下生成gd.so文件,
然后cp [php安装目录]/lib/php/extensions/no-debug-non-zts-20060613/gd.so /opt/php/ext

修改php.ini文件加载gd组件,添加extension_dir=/opt/php/ext和extension=gd.so,如果有extension_dir=/opt/php/ext则不需要增加
Java代码
extension_dir=/opt/php/ext
extension=gd.so


相关:
http://kenneth.ycool.com/index155.html
http://hi.baidu.com/evilrapper/blog/item/eac02852071c7c110cf3e3f2.html
http://hi.baidu.com/%C9%BD%BA%D3%D2%BB%C3%CE/blog/item/5defc93d3a607edc9e3d62d4.html
2011-08-26 16:16:13 iteye_15052 阅读数 121
[size=medium][b]1. 先检查系统是否已经安装gd库[/b][/size]
安装gd库需要jpeg、png等,jpeg的主要文件有jpeglib.h, libjpeg.a, libjpeg.so等。首先检查系统中安装了没有,到/usr/include目录下看有无jpeglib.h,到/usr/lib目录下看有无 libjpeg.a和libjpeg.so,若没有则需要先安装jpeg。查看gd是否安装,GD的主要文件有gd.h, libgd.a等,到/usr/local/include目录下查看有无gd.h,若没有则需要统一安装gd库。若已经安装gd库则可以直接安装php,把gd库追加到php里面即可。
若没安装则先安装gd库。
[size=medium][b]2. gd库的安装[/b][/size]
(1) 下载下列包:
[color=green]jpegsrc.v6b.tar.gz
libpng-(version).tar.gz
freetype-(version).tar.gz
gettext-(version).tar.gz
gd-(version).tar.gz[/color]
(2) 安装jpeg-6b(支持jpeg):
(2.1) 执行如下命令创建目录:
mkdir -p [jpeg-6b安装目录]
mkdir -p [jpeg-6b安装目录]/bin/
mkdir -p [jpeg-6b安装目录]/lib/
mkdir -p [jpeg-6b安装目录]/include/
mkdir -p [jpeg-6b安装目录]/man/
mkdir -p [jpeg-6b安装目录]/man/man1/

(2.2) 解压jpegsrc.v6b.tar.gz
(2.3) 进入[jpeg-6b解压目录],执行如下命令,替换文件:
cp /usr/share/libtool/config.sub .
cp /usr/share/libtool/config.guess .

(2.4) 进入[jpeg-6b解压目录]执行如下命令安装jpeg-6b:
./configure --prefix=[jpeg-6b安装目录] --enable-shared --enable-static
make
make install

(3) 安装libpng(支持png):
解压libpng-(version).tar.gz,进入[libpng解压目录]执行如下命令安装libpng:
./configure --prefix=[libpng安装目录] --enable-shared --enable-static
make
make install

(4) 安装freetype:
解压freetype-(version).tar.gz,进入[freetype解压目录]执行如下命令安装freetype:
./configure --prefix=[freetype安装目录]
make
make install

(5) 安装gettext(安装gd可能需要):
解压gettext-(version).tar.gz,进入[gettext解压目录]执行如下命令安装gettext:
./configure --prefix=[gettext安装目录]
make
make install

(6) 安装gd:
解压gd-(version).tar.gz,进入[gd解压目录]执行如下命令安装gd:
./configure --prefix=[gd安装目录] --with-jpeg=[jpeg-6b安装目录] --with-png=[libpng安装目录] --with-freetype=[freetype安装目录] --with-gettext=[gettext安装目录]
(如./configure --prefix=/opt/gd-2.0.35 --with-jpeg=/opt/jpeg-6b/ --with-png=/opt/libpng-1.2.35/ --with-freetype=/opt/freetype-2.3.5/ --with-gettext=/opt/gettext-0.17/)
make
make install

安装时如果出现
configure.ac:64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.

查看/usr/lib目录下的libattr.a是不是灰色的,没有权限。如果是输入以下命令
chmod 777 libattr.a
[size=medium][b]3. 将gd添加到php[/b][/size]
向php添加gd支持有两种方式,一种是初始安装,一种是追加安装。初始安装也有两种情况:一种是系统自带有gd时,用初始安装的方式,见3.1的(1);另一种是安装gd第三方插件,使用初始安装方式,按照3.1的(2)的方式安装(建议使用)。最后是追加安装,见3.2。(注:php-5.3.6只能用初始编译安装的方法添加gd)

3.1 初始编译安装
在64位系统下还需要运行下面两句命令,来覆盖掉原有的/usr/lib/libjpeg.so和/usr/lib/libpng.so:
ln -s /usr/lib64/libjpeg.so.62.0.0  /usr/lib/libjpeg.so 
ln -s /usr/lib64/libpng.so.3.10.0 /usr/lib/libpng.so

编译php时,向./configure命令追加如下内容--with-jpeg=[jpeg-6b安装目录] --with-png=[libpng安装目录] --with-freetype=[freetype安装目录] --with-gettext=[gettext安装目录] --with-gd=[gd安装目录]
(1) 系统自带有gd
tar zxvf php-5.3.6.tar.gz
cd php-5.3.6
./configure --with-config-file-path=[php安装目录] --prefix=[php安装目录] --with-bz2 --enable-zip --enable-mbstring --with-apxs2=[apache安装目录]/bin/apxs --with-zlib-dir=/usr/include/ --with-libxml-dir=/usr/lib64/ --with-gd --with-jpeg-dir=/usr/ --with-png-dir=/usr/ --with-freetype-dir=/usr/ --enable-soap --enable-calendar
make
make install

(2) 第三方插件gd
tar zxvf php-5.3.6.tar.gz
cd php-5.3.6
./configure --with-config-file-path=[php安装目录] --prefix=[php安装目录] --with-bz2 --enable-zip --enable-mbstring --with-apxs2=[apache安装目录]/bin/apxs --with-zlib-dir=/usr/include/ --with-libxml-dir=/usr/lib64/ --with-jpeg-dir=/opt/jpeg-6b --with-png-dir=/opt/libpng-1.2.35 --with-freetype-dir=/opt/freetype-2.3.5 --with-gettext=/opt/gettext-0.17 --with-gd=/opt/gd-2.0.35 --enable-soap --enable-calendar
make
make install

将php-5.3.6目录中的php.ini-development文件复制到php安装目录,并重命名为php.ini
3.2 追加编译安装
进入“[php解压目录]/ext/gd”目录,执行如下命令:
[php安装目录]/bin/phpize
./configure --with-php-config=[php安装目录]/bin/php-config --with-jpeg=[jpeg-6b安装目录] --with-png=[libpng安装目录] --with-freetype=[freetype安装目录] --with-gettext=[gettext安装目录] --with-gd=[gd安装目录]
make
make install

安装成功后会在“[php安装目录]/lib/php/extensions/no-debug-non-zts-20060613”目录下生成gd.so文件,
然后cp [php安装目录]/lib/php/extensions/no-debug-non-zts-20060613/gd.so /opt/php/ext

修改php.ini文件加载gd组件,添加extension_dir=/opt/php/ext和extension=gd.so,如果有extension_dir=/opt/php/ext则不需要增加
extension_dir=/opt/php/ext
extension=gd.so

[size=small][b]若追加编译不成功,则用初始编译,参照2.1的(3)[/b][/size]
2019-08-17 17:29:47 ouzhuangzhuang 阅读数 238
  1. 关闭linux的防火墙,执行命令
chkconfig iptables off
  1. 从mysql官网上下载自己适合的mysql版本https://dev.mysql.com/downloads/mysql/5.6.html#downloads[外链图片转存失败(img-mJsZWQwZ-1566034103787)(7EA78BD92C7E430EA5A0569231EA908A)]
  2. 传到服务器上/use/local/java目录下解压
tar -zxvf mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz
  1. 将解压后的文件重命名为mysql
mv  mysql-5.6.45-linux-glibc2.12-x86_64 mysql
  1. 进入Mysql目录,添加MySQL配置,创建Mysql用户组及用户
cp support-files/my-default.cnf /etc/my.cnf

#创建mysql用户组及用户
groupadd mysql
useradd -r -g mysql mysql
  1. 编辑/etc/my.cnf文件
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required
basedir = /usr/local/java/mysql5.6
datadir = /usr/local/java/mysql5.6/data
port = 3306
# server_id = .....
socket = /usr/local/java/mysql5.6/mysql.sock
character-set-server = utf8 
log-error=/usr/local/java/mysql5.6/data/error.log 
pid-file=/usr/local/java/mysql5.6/data/mysqld.pid


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  1. 在mysql当前目录下设定目录的访问权限(注意后面的小点,表示当前目录)
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
  1. 初始化数据(在mysql/bin或者mysql/scripts下有个 mysql_install_db 可执行文件初始化数据库),进入mysql/bin或者mysql/scripts目录下,执行下面命令
./mysql_install_db --verbose --user=root --defaults-file=/etc/my.cnf --datadir=/usr/local/java/mysql5.6/data --basedir=/usr/local/java/mysql5.6 --pid-file=/usr/local/java/mysql5.6/data/mysql.pid --tmpdir=/tmp
  1. 启动mysql,进入/usr/local/mysql/bin目录,执行下面命令
./mysqld_safe --defaults-file=/etc/my.cnf --socket=/usr/local/java/mysql5.6/mysql.sock --user=root &
  1. 设置开机启动,新开启shell中断后,进入mysql目录,执行下面命令
cp /usr/local/java/mysql5.6/support-files/mysql.server /etc/init.d/mysqld
cp /usr/local/java/mysql5.6/support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 700 /etc/init.d/mysql
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
chown mysql:mysql -R /usr/local/java/mysql5.6/

重启 linux 后查看 mysql 状态或者看到3306端口号

reboot
 
service mysqld status  
#查看服务状态显示
MySQL running (1541)                                       [  OK  ]

netstat -na | grep 3306 
#查看端口号显示
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
没有更多推荐了,返回首页