First, install PHP because composer is the tool that PHP uses to manage dependency (dependency) relationships. You can declare your dependencies on the External tool Library (libraries) in your project, and Composer will help you install these dependent library files.
Select Install PHP5.6:
1, pre-installation preparationBefore installing PHP, it is necessary to make sure that Apache is httpd and mysql/mariadb (database) is installed, if not, you need to install Apache and database first. If it's all installed, then you can start installing PHP.
2. Start installing PHP
Reference Blog: 75635334
2.1 Choosing the right Source
CENTOS7 Official source package is too old, update slow, the default is to download version 5.4, which will affect the array operation of the database control code style, so I looked at a few sites selected packages, finally determined to use HTTPS://MIRROR.WEBTATIC.COM/YUM/EL7 /WEBTATIC-RELEASE.RPM, the code is as follows:
#Yum-YInstallEpel-release #安装epel源参考博客: https://blog.csdn.net/w670328683/article/details/51673757The following installation process reference blog: https://blog.csdn.net/u010738364/article/details/75635334#rpm-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpm#YumList php*#查看是否有我们需要的包下载安装对应的包: #Yum-YInstallphp56w php56w-mysql php56w-gd libjpeg* php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mbstring php56w-bcmath PHP Encryption extension library PHP-Mhash, but not seen in the source, so to download separately #YumGroupinstall"Development Tools"#Yum-YInstallMhash Mhash-devel MCrypt
Second, installation php7.x reference blog:
Http://www.php.cn/php-weizijiaocheng-387055.html
73325663
Third, installation composer
Refer to the official installation method: https://pkg.phpcomposer.com/#how-to-install-composer
Before installing, first make sure that PHP is installed correctly
Installation method One: Directly installed is the latest version of the composer
If PHP does not have global variables set, we can add the PHP command to the global variable, and at a later time only the input PHP can be used, the command is as follows:
1. Set global variables (this step can be ignored)
#vim/etc/profile #添加如下内容到最后一行PATH= $PAHT:/usr/local/php-fpm/bin/ #php启动的路径, set according to your own circumstances etc/-v view PHP version 2, global variables are set:
-ss https://getcomposer.org/installer | php2), move Composer.phar file to/usr/local/ The bin directory is the command globally available #mv composer.phar/usr/local/bin/composer3), composer #安装成功
Method Two official:
Installation steps:
- Download the installation script-
composer-setup.php
-to the current directory.
- Perform the installation process.
- Delete the installation script.
#php-V #查看版本号
" copy (' Https://install.phpcomposer.com/installer ', ' composer-setup.php '); " #php composer-"unlink (' composer-setup.php '); " #mv Composer.phar/usr/local/bin/composer
#composer
#composer selfupdate #要经常执行此命令跟新
Install upgrade uninstall Reference blog: 52457666
"Linux ops" install PHP tools composer