橡皮擦擦

Deepin安装php7.3.3

Deepin

下载php-7.3.3.tar.gz

wget -c https://www.php.net/distributions/php-7.3.3.tar.gz

解压

tar zxvf php-7.3.3.tar.gz && cd php-7.3.3

安装依赖

sudo apt install g++ autoconf openssl libssl-dev libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev libxml2 libxml2-dev libxslt1-dev libzip-dev curl libcurl4-gnutls-dev

配置扩展

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-libdir=/lib/x86_64-linux-gnu --disable-rpath --enable-fpm --with-fpm-user=choi --with-fpm-group=choi --with-openssl --enable-bcmath --with-zlib --with-curl --enable-exif --enable-ftp --with-gd --with-webp-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr --with-gettext --with-mhash --enable-intl --enable-mbstring --enable-mbregex --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --with-xmlrpc --with-libxml-dir=/usr --with-iconv-dir --with-xsl --enable-zip --with-libzip --enable-mysqlnd

编译安装(耗时约 5 分钟)

make -j4
sudo make install
sudo ln -s /usr/local/php/sbin/php-fpm /usr/sbin/php-fpm

设置环境变量,编辑/etc/profile,将php/bin加入环境变量

export PATH="$PATH:/usr/local/php/bin"

配置生效

source /etc/profile

下载composer

php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"

安装composer

php composer-setup.php

删除安装脚本

php -r "unlink('composer-setup.php');"

将composer加入环境变量

sudo mv composer.phar /usr/local/bin/composer
点我评论
打赏本文
二维码


36

文章

6

分类