PHP[001]:INSTALL

ubuntu

ubuntu 中软件的卸载方法:

1.apt方式安装:(相应的文件夹有相关的软件,先进入到软件的文件夹) 普通安装: sudo apt-get install 软件名 修复安装: sudo apt-get -f install 软件名 重新安装: sudo apt-get --rreinstall install 软件名  (一般是 .deb 格式) 2.dpkg 方式: 1.普通安装:sudo dpkg -i package_name.deb ===================================== 如果软件的格式为 .rpm 格式包时,则 1.先安装 alien 和 fakeroot 这两个工具, sudo apt-get install alien fakeroot alien 把 .rpm 为 .deb 格式的文件 1. 将 .rpm 格式的文件转为 同文件名的 .deb fakeroot alien xx.rpm 这样就可以按上面的方法安装了

1.apt 方式: a. 移除式卸载: apt-get remove 软件名 b. 清除式卸载: apt-get --purge remove 软件名 (同时清除配置) c. 清除式卸载: apt-get --purge 软件名 (同时清除配置)

2.dpkg 方式: a. 移除式卸载:sudo dpkg dpkg_name b. 清除式卸载:sudo -P dpkg_name

查看已经安装的软件名称:

dpkg -l

查找软件库中的软件 apt-cache search 正则表达式 或者 aptitude search 软件包(部分) 可以查看相关软件的名称 标志 i 表示已经安装

apt-cache search php7

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16


./configure \
--prefix=/usr/local/php73 \
--exec-prefix=/usr/local/php73 \
--bindir=/usr/local/php73/bin \
--sbindir=/usr/local/php73/sbin \
--includedir=/usr/local/php73/include \
--libdir=/usr/local/php73/lib/php \
--mandir=/usr/local/php73/php/man \
--with-config-file-path=/usr/local/php73/etc \
--with-openssl \
--enable-mbstring \
--enable-fpm

sudo make && sudo make install

编译

1
2
3
4
5
6
7
8
# php7.1
./configure --prefix=/usr/local/php71 --with-config-file-path=/usr/local/php71/etc --with-config-file-scan-dir=/usr/local/php71/conf.d --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-intl --with-xsl --enable-maintainer-zts
./configure --with-php-config=/usr/local/php71/bin/php-config --with-readline

# php7废弃的扩展
# --with-mysql=mysqlnd

sudo make && sudo make install
1
2
3
4
5
6
Warning! a PEAR user config file already exists from a previous PEAR installation at '/home/hanzhijie/.pearrc'. You may probably want to remove it.
Wrote PEAR system config file at: /usr/local/php71/etc/pear.conf
You may want to add: /usr/local/php71/lib/php to your php.ini include_path
/mnt/c/Users/hzj/Desktop/boom/tmp/php-7.1.26/build/shtool install -c ext/phar/phar.phar /usr/local/php71/bin
ln -s -f phar.phar /usr/local/php71/bin/phar
Installing PDO headers: /usr/local/php71/include/php/ext/pdo/

php7.3

1
2
3
4
5
6
7


./configure --prefix=/usr/local/php73 --with-config-file-path=/usr/local/php73/etc --with-config-file-scan-dir=/usr/local/php73/conf.d --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-intl --with-xsl --with-kerberos --enable-sysvshm --enable-opcache --enable-libxml --with-bz2 --with-pear --with-pdo-sqlite --with-pcre-regex --with-libdir=lib64 --with-kerberos --enable-maintainer-zts
./configure --with-php-config=/usr/local/php73/bin/php-config --with-readline
# php7.2废弃的扩展
# --with-mcrypt --enable-gd-native-ttf

1
2
3
4
5
6
Warning! a PEAR user config file already exists from a previous PEAR installation at '/home/hanzhijie/.pearrc'. You may probably want to remove it.
Wrote PEAR system config file at: /usr/local/php73/etc/pear.conf
You may want to add: /usr/local/php73/lib/php to your php.ini include_path
/mnt/c/Users/hzj/Desktop/boom/tmp/php-7.3.2/build/shtool install -c ext/phar/phar.phar /usr/local/php73/bin
ln -s -f phar.phar /usr/local/php73/bin/phar
Installing PDO headers: /usr/local/php73/include/php/ext/pdo/

pthreads 安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
----------------------------------------------------------------------
Libraries have been installed in:
/mnt/c/Users/hzj/Desktop/boom/tmp/pthreads-master/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions: /usr/local/php73/lib/php/extensions/no-debug-zts-20180731/