从编译安装php开始,到composer.不自己去操作一遍.还真不知道少安这么多依赖~
# 进入php的源码包的ext目录中
cd php-7.3.3/ext/
cd openssl/
cp config0.m4 config.m4
/usr/local/php/bin/phpize
./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
make && make install
# 添加php.ini的配置
find / -name 'php.ini'
vim /usr/local/php/lib/php.ini
# 添加
extension=openssl.so
# 保存退出,查看结果
php -m | grep open
openssl
未安装openssl执行php install结果
[root@bogon softpackage]# php installer
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
# 进入php的源码包的ext目录中
cd php-7.3.3/ext/
cd zlib
cp config0.m4 config.m4
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-zlib=/usr
make && make install
# 编辑配置文件添加
vim /usr/local/php/lib/php.ini
extension=zlib.so
# 查看结果
php -m | grep zlib
zlib
未安装zlib执行php install结果
[root@bogon softpackage]# php installer
Downloading...
Composer (version 1.8.6) successfully installed to: /data/softpackage/composer.phar
Use it: php composer.phar
Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:
The zlib extension is not loaded, this can slow down Composer a lot.
If possible, install it or recompile php with --with-zlib
The php.ini used by your command-line PHP is: /usr/local/php/lib/php.ini
If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.
wget https://getcomposer.org/installer
php installer
mv composer.phar /usr/bin/composer
composer -v
# 报错
/usr/bin/env: php: 没有那个文件或目录
# 为php添加软连接
ln -s /usr/local/php/bin/php /usr/local/bin/php
composer -v
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
# 设置中国镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com